You are here

protected function OrgPermissions::buildPermissions in RedHen CRM 8

Builds a standard list of permissions for a given org type.

Parameters

\Drupal\redhen_org\Entity\OrgType $org_type: The machine name of the org type.

Return value

array An array of permission names and descriptions.

1 call to OrgPermissions::buildPermissions()
OrgPermissions::OrgTypePermissions in modules/redhen_org/src/OrgPermissions.php
Returns an array of RedHen org type permissions.

File

modules/redhen_org/src/OrgPermissions.php, line 37

Class

OrgPermissions

Namespace

Drupal\redhen_org

Code

protected function buildPermissions(OrgType $org_type) {
  $type_id = $org_type
    ->id();
  $type_params = [
    '%type' => $org_type
      ->label(),
  ];
  return [
    "add {$type_id} org" => [
      'title' => $this
        ->t('%type: Add org', $type_params),
    ],
    "view active {$type_id} org" => [
      'title' => $this
        ->t('%type: View active orgs', $type_params),
    ],
    "view inactive {$type_id} org" => [
      'title' => $this
        ->t('%type: View inactive orgs', $type_params),
    ],
    "edit {$type_id} org" => [
      'title' => $this
        ->t('%type: Edit orgs', $type_params),
    ],
    "delete {$type_id} org" => [
      'title' => $this
        ->t('%type: Delete orgs', $type_params),
    ],
  ];
}