function og_role_create in Organic groups 7.2
Create a stub OG role object.
Parameters
$name: A name of the role.
$group_type: (optional) The entity type of the group.
$gid: (optional) The group ID.
$group_bundle: (optional) The bundle of the group.
Return value
A stub OG role object.
6 calls to og_role_create()
- OgMigrateOgurRoles::import in includes/
migrate/ 7000/ og_ogur_roles.migrate.inc - Create group, group-audience and group description fields.
- OgMigrateRoles::preImport in includes/
migrate/ 7200/ og_roles.migrate.inc - Copy all existing global roles to bundle-specific versions. Although similar processing is available through the og_roles_override() function, special handling is necessary to ensure that custom global roles are copied as well as default global roles.
- OgRoleRevoke::testOgRoleRevoke in ./
og.test - og_features_permission_features_rebuild in includes/
og_features_permission.features.inc - Implements hook_features_rebuild().
- og_roles_override in ./
og.module - Create new roles, based on the default roles and permissions.
File
- ./
og.module, line 2859 - Enable users to create and manage groups with roles and permissions.
Code
function og_role_create($name, $group_type = '', $gid = 0, $group_bundle = '') {
$role = new stdClass();
$role->name = $name;
$role->gid = $gid;
$role->group_type = $group_type;
$role->group_bundle = $group_bundle;
return $role;
}