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

Prevent users adding non-existing Members to Security Groups


Go to End


3 Posts   1612 Views

Avatar
dizzystuff

Community Member, 94 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, 94 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 http://www.silverstripe.org/customising-the-cms/show/282214 - 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!