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.

Archive

Our old forums are still available as a read-only archive.

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

canDelete


Reply

1014 Views

Avatar
toddm

25 September 2008 at 2:20am Community Member, 15 Posts

Hi,

I'm working on customizing permissions and have the following update to Page.php:

class Page extends SiteTree {
   static $db = array(
   );
   static $has_one = array(
);

protected $publisherGroups = array(
    "Administrators" //,
    // "Editors"
   );
   
   function canPublish() {
    $member = Member::currentUser();
    return $member->inGroups($this->publisherGroups);
   }
   
   function canDelete() {
    $member = Member::currentUser();
    return $member->inGroups($this->publisherGroups);
   }
}

So, I can't Delete from Batch Actions, but users in the Editors group can still Delete from the "Delete from Draft Site" and subsequent "Delete from Published Site" buttons in the lower right?