Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Get permissions of current user: "Edit any page"


Reply


2 Posts   1123 Views

Avatar
DeklinKelly

Community Member, 197 Posts

13 August 2010 at 2:09pm

Under "Permissions" in the CMS there is a checkbox: "Edit any page"

How can I access this in a Controller for the current user?

I see lots of information about the current user here but nothing about permissions:

$member = Member::currentUser();
print_r($member);

Avatar
DeklinKelly

Community Member, 197 Posts

13 August 2010 at 2:34pm

I found the answer. This does what I need:

function AuthorizedAuthor () {
   return SiteTree::canEdit();
}