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.

Customising the CMS /

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

Remove delete and unpublish buttons


Go to End


3 Posts   2620 Views

Avatar
deLisle

Community Member, 12 Posts

4 June 2009 at 1:37am

Hi.

I was wondering if it's possible with access rights to hide the delete and unpublish buttons from site content for certain user groups.

Thanks.

Avatar
Ingo

Forum Moderator, 801 Posts

5 June 2009 at 8:14am

Just overload Page->canDelete() and canPublish(), see SiteTree methods for details on how to code these.

Avatar
deLisle

Community Member, 12 Posts

5 June 2009 at 6:50pm

The problem is that in the SiteTree class in core/model the if statement for the delete button only checks canEdit. I had to override the method getCMSActions and update the if statement to: if($this->canEdit() && $this->canDelete())