Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Publish Permissions

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

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

Page: 1
Go to End
Author Topic: 1298 Views
  • davidinottawa
    Avatar
    Community Member
    1 Post

    Publish Permissions Link to this post

    Hi - I thought this is basic CMS requirements - so maybe I'm missing something.

    I need to create a group (say Editors) that can only Create/Add/Update pages - not publish.
    Only the administrator has the right to publish to the live site.

    How is this accomplished ?

    Based on an earlier post to the forum, I tried to add the canPublish function to the Page_controller class without success :
       protected $publisherGroups = array(
        "Administrators"
       );

       function canPublish() {
        $member = Member::currentUser();
        return $member->inGroups($this->publisherGroups);
       }

    Thanks - impressed with SilverStripe so far.
    I'm comparing with TypoLight and BigMedium.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Publish Permissions Link to this post

    Hi there, sorry for the late answer. We've done a bit of work lately to better enforce the SiteTree->can*() permissions in the CMS-Controllers, which is going to be released with 2.3 soon. Sam is also working on a basic workflow module, you can check its progress here: http://open.silverstripe.com/browser/modules/cmsworkflow/trunk

    As a sidenote, we usually check against permission codes rather than groups directly. So your canPublish() logic could also be implemented like so:

    function canPublish($member = null) {
    return Permission::checkMember($member, 'ADMIN');
    }

    With the PermissionProvider interface, you can add your own permission codes for a more flexible management.

    1298 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.