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.

Customising the CMS /

Prevent users adding non-existing Members to Security Groups


Reply


3 Posts   1149 Views

Avatar
dizzystuff

Community Member, 93 Posts

15 March 2010 at 4:34am

Yo SS-folk

Is it possible to prevent users from adding new Members to Security Groups via the Security Admin? That is, if the Member doesn't already exist, the user is prevented or given an error when they try to add them to a Group? For the site I'm working on I'm decorating Member and managing it via ModelAdmin so I'd rather users couldn't also add Members via the Security Admin accidentally/on-purpose.

Cheers
Dizzy

Avatar
Ingo

Forum Moderator, 801 Posts

13 April 2010 at 8:33pm

Not directly... You could extend MemberTableField->addToGroup() to check for a customized Member->canCreate() callback.

Avatar
dizzystuff

Community Member, 93 Posts

14 April 2010 at 4:47pm

Hi Ingo

Thanks for getting back to me on this. The context for my query is in this post here [url]http://www.silverstripe.org/customising-the-cms/show/282214[/url] - I'd be very keen to hear your feedback on it?

I'll have a good look at MemberTableField and see what I can do. Your suggestion sounds like a pretty neat way to do it.

Thanks!