#1656 - Add a new user to security group via Logic Hook
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
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago