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

Adding Multiple Users to a Security Group at a time


Go to End


3 Posts   2742 Views

Avatar
BrysaniStudios

Community Member, 12 Posts

20 April 2010 at 12:14pm

Hello,
I'm new to silverstripe and I'm pretty familiar with php, but this cms is throwing me off a bit, haven't worked with oop php too much. Anyways, i'm porting a site over to this cms and i have a set of users that i'd like to insert into a security group, but it seems you can only insert one at a time... is there a way to insert more then one?

-Bryant

Avatar
Willr

Forum Moderator, 5523 Posts

20 April 2010 at 6:21pm

So I take it your adding members to a group programmatically rather than through a UI?. The group -> member relation is wrapped in a ComponentSet which has a method addMany() which you could call

$group->addMany($members);

Where $group would be your group object and $members a dataobjectset of the members you wish to add.

Avatar
BrysaniStudios

Community Member, 12 Posts

21 April 2010 at 8:56am

Through the UI would be the most helpful, but if that can't be done, then I guess it needs to be done programatically. I saw that it can export csv, but no import? I would only need to do it once, so should i do it through phpmyadmin then instead?