Reputation: 35
I've been working with SugarCRM by creating a custom module and a custom PHP file to that module. I need to display all the Roles available to Users and have the data displayed on the custom PHP page.
I have looked in to getAllRoles() function and...
ACLRole::getAllRoles(boolean $returnAsArray=false);
Can any one help me get these functions to work properly?
(Please answer only if you know the answer and do not close the question with false reasons.)
Upvotes: 1
Views: 1117
Reputation:
You can easily get all Roles that aren't deleted, you will find the method in /modules/ACLRoles/ACLRole.php. It will return either an array of array representations of acl roles or an array of ACLRoles.
The query is:
'SELECT acl_roles.* FROM acl_roles WHERE acl_roles.deleted=0 ORDER BY name';
Try this code:
$roles = array();
$roles = ACLRole::getAllRoles(true);
print_r($roles);
sugar_die();
Hope that helps.
Upvotes: 3