Merge "Add (optional) logging statements on some permission checks." into sc-dev