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

user permissions in backend


Go to End


2 Posts   2323 Views

Avatar
danzzz

Community Member, 175 Posts

5 February 2011 at 11:57pm

hi,

I should do a project where I can add companies, categories and items (products) to the categories in the backend.
For the company data I want to extend user or want to use the memberprofiles module.

For categories and products I want to create own pagetypes with own fields ...

If all this is done, it's no problem to use this with the admin account, but how it's possible to let every user login to backend
and edit his data (profile, adding, editing products)?

is there a good doc where I can see how to add permissions to my content types?

Daniel

Avatar
nakashu

Community Member, 24 Posts

10 February 2011 at 2:53am

Take a look at this module : http://silverstripe.org/simplify-module/
there you have the ability to set permisions per page. - if you wont use it you can just see there how it is done.

also if you want to cech security permision by user groups you can do something like this

// if not administrator remove fields
if ( !Permission::check('administrators')) {
	$fields->removeByName('Access');
	$fields->removeByName('GoogleSitemap');
}
// if not someoneelse remove blabla field
if ( !Permission::check('someoneelse')) {
	$fields->removeByName('blabla');
}

this use in getCMSFields but can you can use it everywhere

And for sure look on these nice articles
http://www.ssbits.com/tutorials/2010/site-members-registering-users-and-allowing-them-to-edit-their-details/
http://www.ssbits.com/snippets/2009/hide-pages-in-sitetree-that-a-user-can-t-edit/
http://www.ssbits.com/snippets/2009/create-an-edit-this-page-link/