You are here

function _user_relationship_node_access_get_allowed_grants in User Relationships 7

Same name and namespace in other branches
  1. 6 user_relationship_node_access/user_relationship_node_access.module \_user_relationship_node_access_get_allowed_grants()

Find the list of permissions that a user is allowed to grant

Parameters

$account: user to check, if not the current user

Return value

array of zero or more of ('view', 'update', 'delete')

2 calls to _user_relationship_node_access_get_allowed_grants()
user_relationship_node_access_update_node in user_relationship_node_access/user_relationship_node_access.module
_user_relationship_node_access_permission_form in user_relationship_node_access/user_relationship_node_access.module
Helper function to generate the permissions grid for a node edit form or for a user edit form.

File

user_relationship_node_access/user_relationship_node_access.module, line 477
Allows content posted to be shared with users in one's social network

Code

function _user_relationship_node_access_get_allowed_grants($account = NULL) {
  $allowed_grants = array();
  foreach (array(
    'view',
    'update',
    'delete',
  ) as $type) {
    if (user_access('grant ' . $type . ' permission to related users', $account)) {
      $allowed_grants[$type] = $type;
    }
  }
  return $allowed_grants;
}