Jump to:

5521 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Remove delete and unpublish buttons

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

Page: 1
Go to End
Author Topic: 1406 Views
  • deLisle
    Avatar
    Community Member
    12 Posts

    Remove delete and unpublish buttons Link to this post

    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.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Remove delete and unpublish buttons Link to this post

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

  • deLisle
    Avatar
    Community Member
    12 Posts

    Re: Remove delete and unpublish buttons Link to this post

    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())

    1406 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.