Get security groups for a user

In SugarCRM, there was the function get_my_teams() in a current_user that would gives the teams a user belongs to.

In SuiteCRM, with the use of Security Groups, how can I do something similar? I tried the field SecurityGroups, but it only gives me 1. I’m using SuiteCRM 7.0.1.

Thanks for any help!

Best,

sicay

look at getUserSecurityGroups in modules/SecurityGroups/SecurityGroup.php

I found that. However, I must load a SecurityGroup object first, and ask for the security groups for a user. There surely must be a may more straightforward like the function get_my_teams() in SugarCRM. That’s what I’m looking for, if it exists.

Thanks for your answer!

sicay

require_once(‘modules/SecurityGroups/SecurityGroup.php’);
global $current_user;
$security_group_arr = SecurityGroup::getUserSecurityGroups($current_user->id);

You can use this function to get the user’s security group array