You are here

function entity_legal_permission in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.module \entity_legal_permission()

Implements hook_permission().

File

./entity_legal.module, line 232
Entity Legal module.

Code

function entity_legal_permission() {
  $permissions['administer entity legal'] = array(
    'title' => t('Administer legal documents'),
    'description' => t('Change global legal document settings.'),
  );
  foreach (entity_legal_get_all_documents(FALSE) as $document) {
    $permissions[$document
      ->getPermissionView()] = array(
      'title' => t('View "@name"', array(
        '@name' => $document->name,
      )),
      'description' => 'Allow users to view the legal document.',
    );
    $permissions[$document
      ->getPermissionExistingUser()] = array(
      'title' => t('Re-accept "@name"', array(
        '@name' => $document->name,
      )),
      'description' => 'Existing user roles that must re-accept the legal document.',
    );
  }
  return $permissions;
}