You are here

function og_delete_user_roles_by_group in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og.module \og_delete_user_roles_by_group()

Delete all roles belonging to a group.

Parameters

$gid: The group ID.

2 calls to og_delete_user_roles_by_group()
OgGroup::delete in ./og.module
Permanently deletes the entity.
og_field_crud_group in ./og.field.inc
Create update or delete a group, based on the field CRUD.

File

./og.module, line 2661
Enable users to create and manage groups with roles and permissions.

Code

function og_delete_user_roles_by_group($gid) {

  // Check if group has overriden roles defined.
  if ($roles = og_roles($gid, NULL, TRUE)) {
    foreach ($roles as $rid => $name) {
      og_role_delete($rid);
    }
  }
}