function og_ui_access_group_permissions in Organic groups 7.2
Menu access; Check access and validate values for group permissions page.
Parameters
$rid:
$group_type:
$gid:
$bundle:
1 string reference to 'og_ui_access_group_permissions'
- og_ui_menu in og_ui/
og_ui.module - Implements hook_menu().
File
- og_ui/
og_ui.module, line 342 - Organic groups UI.
Code
function og_ui_access_group_permissions($group_type, $bundle, $gid = 0, $rid = 0) {
if (!user_access('administer group')) {
return FALSE;
}
if ($group_type && !entity_get_info($group_type)) {
return FALSE;
}
if ($gid && !entity_load_single($group_type, $gid)) {
return FALSE;
}
if ($rid) {
$og_roles = og_roles($group_type, $bundle, $gid);
return !empty($og_roles[$rid]);
}
return TRUE;
}