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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

canDelete


Go to End


1259 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?