by eggsurplus

Control what your users can access and save time, money, and frustrations. Lock down sensitive data in SugarCRM or SuiteCRM to specific groups or teams. Supports unlimited assigned users, unlimited group assignments to records, custom layouts for each group, login/sudo capabilities and much more.

Free 30 day trial
Try it Now

By clicking you consent to share your profile with the developer

#1656 - Add a new user to security group via Logic Hook

Closed General Question created by EliasJ 9 years ago
I am trying to automatically add new users to a security group via a logic hook every time a new user is created. Below is what I have managed to put together myself but it just doesn't seem to work. $sgroupx = new SecurityGroup(); $sgroupx->retrieve_by_string_fields(array('name'=>'Owner_Only_Group','deleted'=>0)); $sgroupx->load_relationship('securitygroups_users'); $sgroupx->securitygroups_users->add($bean->id); Any advice or sample code that you may have to help will be appreciated, Cheers
  1. eggsurplus member avatar

    eggsurplus Provider Affiliate

    9 years ago

  2. EliasJ member avatar

    EliasJ

    9 years ago

  3. eggsurplus member avatar

    eggsurplus Provider Affiliate

    9 years ago

  4. EliasJ member avatar

    EliasJ

    9 years ago

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
Rating
  • "The perfect solution for managing security. Very stable and easy to implement. Must-have add-on for every CE implementation!"

    Read More Reviews