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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

canDelete


Go to End


1337 Views

Avatar
toddm

Community Member, 15 Posts

25 September 2008 at 2:20am

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?