Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Adding Multiple Users to a Security Group at a time

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

Page: 1
Go to End
Author Topic: 1890 Views
  • BrysaniStudios
    Avatar
    Community Member
    12 Posts

    Adding Multiple Users to a Security Group at a time Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Adding Multiple Users to a Security Group at a time Link to this post

    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.

  • BrysaniStudios
    Avatar
    Community Member
    12 Posts

    Re: Adding Multiple Users to a Security Group at a time Link to this post

    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?

    1890 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.