You are here

function user_relationships_ui_permission in User Relationships 7

Implements hook_perm().

File

user_relationships_ui/user_relationships_ui.module, line 235
UI components of user_relationships @author Jeff Smick (creator) @author Alex Karshakevich (maintainer) http://drupal.org/user/183217 @author Darren Ferguson (contributor) http://drupal.org/user/70179

Code

function user_relationships_ui_permission() {
  $permissions = array();
  foreach (user_relationships_types_load() as $type) {
    $permissions['view own ' . $type->machine_name . ' relationships'] = array(
      'title' => t('View own %name relationships', array(
        '%name' => $type->name,
      )),
      'description' => t('The user is allowed to see his own relationships of this type.'),
    );
    $permissions['view all ' . $type->machine_name . ' relationships'] = array(
      'title' => t('View all %name relationships', array(
        '%name' => $type->name,
      )),
      'description' => t('The user is allowed to see all relationships of this type.'),
    );
  }
  return $permissions;
}