function og_create_global_role in Organic groups 7
Add a new global role - a role associated to group ID 0.
Parameters
$name: The role name.
Return value
The role object populated iwth the role ID.
1 call to og_create_global_role()
- og_set_global_access_module in ./
og.module - Add default roles and permissions of a module to the global permissions.
File
- ./
og.module, line 2517 - Enable users to create and manage groups with roles and permissions.
Code
function og_create_global_role($name) {
$role = new stdClass();
$role->name = $name;
$role->gid = 0;
og_role_save($role);
return $role;
}