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.

General Questions /

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

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

Model Admin Permission


Go to End
Reply


7 Posts   2076 Views

Avatar
ttyl

Community Member, 114 Posts

28 May 2010 at 7:24am

I saw there was another thread of this but it didn't answer my question. I want to give a user access to a model admin and nothing else. I can make it happen so they log in and see the model admin page but they can only search, not add. when I check "Full administrative rights" they can see everything and add objects. however, if I uncheck "Full administrative rights" but still check every single other box they can search but not add - so something strange is going on. anybody know how to fix this?

Avatar
swaiba

Forum Moderator, 1823 Posts

28 May 2010 at 8:46pm

Edited: 28/05/2010 8:47pm

override the following functions like this for each dataobject that is being managed...

	function canCreate() {return true;}
	function canEdit() {return true;}
	function canDelete() {return true;}

Barry

Avatar
ttyl

Community Member, 114 Posts

3 June 2010 at 4:03am

Thanks Barry, that works.

Avatar
steve_nyhof

Community Member, 224 Posts

24 June 2010 at 8:17am

where do I find the file to add these entries?

Avatar
ttyl

Community Member, 114 Posts

24 June 2010 at 8:20am

add to your dataobject class.

ie

class MyDataObject extends DataObject {
.....
function canCreate() {return true;}

}

?>

Avatar
steve_nyhof

Community Member, 224 Posts

24 June 2010 at 9:21am

Thank you, and what file would that be in?

Avatar
TotalNet

Community Member, 181 Posts

24 June 2010 at 9:52am

It's in the file containing the dataobject class you want to apply the permission to.

see my reply to your other question for a more comprehensive answer

Rich