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, simon_w

ModelAdmin 'Create' permissions


Reply


5 Posts   1907 Views

Avatar
JoshuaLewis

Community Member, 76 Posts

22 March 2010 at 7:48am

Edited: 22/03/2010 7:54am

I'm using a ModelAdmin subclass to manage a list of front-end users which are extended from Member. Everything is functioning just fine except that only members of the main administrator group can create and edit these new members and I want my Editor user group to have these privileges as well.

I've added the relevant permissions to the editor group through the Security.Permissions tab and even tried adding canCreate and canEdit to my Member and ModelAdmin sub-classes but nothing seems to work.

Does anyone know how I go about granting my Editor group the permissions needed to create and edit these Members through ModelAdmin?

I'm using SS v.2.3.7 with the 2.3 branch of DataObjectManager and SWFUploadField as well as the stable release of Multi-Step Form.

Avatar
mirkosassetti

Community Member, 20 Posts

31 March 2010 at 6:17am

Same problem here ... i'm investigating but nothing found yet.

Avatar
mirkosassetti

Community Member, 20 Posts

31 March 2010 at 10:32pm

Probably my problem isn't really the same.
My problem was with standard extended classes of DataObject used with ModelAdmin. With only access permission in the member group the user could only view ModelAdmin interface, but not add or edit items.
Next i try to add this code on my managed DataObject classes

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

and now users of groups other than Administrator can add and edit items (if i set access permissions in in security tab).

Avatar
JoshuaLewis

Community Member, 76 Posts

1 April 2010 at 9:33am

Thanks mirkosassetti, that works on my setup as well. It looks like all four functions are needed and not just canCreate() and canEdit()

Avatar
Corry

Community Member, 17 Posts

29 January 2012 at 10:05pm

Thanks for posting that code, mirkosassetti. It solved my issue too.