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.

Archive /

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

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

Publish Permissions


Reply


2 Posts   1411 Views

Avatar
davidinottawa

Community Member, 1 Post

8 October 2008 at 5:28am

Edited: 08/10/2008 5:32am

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.

Avatar
Ingo

Forum Moderator, 801 Posts

10 November 2008 at 3:49am

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.