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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

is silverstripe the correct cms?


Go to End


6 Posts   1552 Views

Avatar
dreamstudio

Community Member, 48 Posts

4 March 2009 at 8:54am

Edited: 04/03/2009 9:07am

We are trying to narrow down the cms for a client who has specific requirements which are below

They need people to login to the admin area with different user roles.. we see you can do this in silverstripe and then set what permissions they have, one thing my client wants is the ability for just the overall administrator to publish the content, everyone else... or everyone within a different group only to be able to save... is this possible to switch off the publish button for everyone except certain groups?

is it also possible for people within a group to only see certain parts of the admin.... I know we can turnoff comments, reports etc access.. but what about in editing pages... can we turn off translations, access... reports.. metadata for certain groups so they literally just can edit the page and click save

Avatar
Willr

Forum Moderator, 5523 Posts

4 March 2009 at 1:39pm

I dont know if you can hide tabs as such as I haven't used the permissions system in the backend alot but you do have access to a couple functions like canView(), canPublish(), canEdit() that you can use for permissions such as hiding publishing actions etc.

You might find the cms workflow module quite handy for this http://doc.silverstripe.com/doku.php?id=modules:cmsworkflow

Avatar
Sam

Administrator, 690 Posts

4 March 2009 at 4:53pm

Hi dreamstudio,

We're releasing a cmsworkflow module in the near future that will give you the features that you need.

Thanks,
Sam

Avatar
Carbon Crayon

Community Member, 598 Posts

5 March 2009 at 12:12am

Edited: 05/03/2009 12:15am

Hi Dream studio

You can achiev those things already by adding some simple code to your page.php model class.

To remove tabs from users that are not admins I do this:


function getCMSFields(){
.
.
.
if(!Member::currentUser()->isAdmin()){

$fields->removeByName("Access"):
}
.
.
.
}

You could easily extend this to chech for groups by doing Member::currentUser->inGroup($GroupID) or if you needed to be able to assign groups permission rights from with the CMS you could create a new permission role (see the forum module) and use Permission::check('YourRoleName')

To remove publish rights you can use the canPublish() function in your page model like so:

function canPublish(){
if(Member::currentUser()->isAdmin()){
return true;
}else{
return false;
}

Again this can be extended to take groups into account.

Hope that helps :)

Avatar
Sam

Administrator, 690 Posts

5 March 2009 at 9:19am

One small suggestion - you should use Permission::check("ADMIN") instead of $member->isAdmin() :-).

Avatar
Carbon Crayon

Community Member, 598 Posts

5 March 2009 at 10:09am

Hey sam, thanks for the tip :) Just out of interest how does the permission check differ from the member functions?

Is there an equivilent for checking groups or is the ->inGroup() still the best way to do that?