You are here

function opigno_calendar_event_set_permissions in Opigno calendar event 8

Same name and namespace in other branches
  1. 3.x opigno_calendar_event.install \opigno_calendar_event_set_permissions()

Sets roles opigno calendar event permissions.

2 calls to opigno_calendar_event_set_permissions()
opigno_calendar_event_install in ./opigno_calendar_event.install
Implements hook_install().
opigno_calendar_event_update_8002 in ./opigno_calendar_event.install
Setup calendar events permissions.

File

./opigno_calendar_event.install, line 39
Install, update and uninstall functions for the Opigno Calendar Event module.

Code

function opigno_calendar_event_set_permissions() {
  $role = Role::load(RoleInterface::AUTHENTICATED_ID);
  $role
    ->grantPermission('create opigno_calendar_event');
  $role
    ->grantPermission('view own opigno calendar event');
  $role
    ->grantPermission('update own opigno calendar event');
  $role
    ->grantPermission('delete own opigno calendar event');
  $role
    ->grantPermission('add members to calendar event');
  $role
    ->save();
  $role = Role::load('content_manager');
  $role
    ->grantPermission('view opigno_calendar_event');
  $role
    ->grantPermission('update opigno_calendar_event');
  $role
    ->grantPermission('delete opigno_calendar_event');
  $role
    ->grantPermission('add any members to calendar event');
  $role
    ->save();
  $role = Role::load('user_manager');
  $role
    ->grantPermission('view opigno_calendar_event');
  $role
    ->grantPermission('update opigno_calendar_event');
  $role
    ->grantPermission('delete opigno_calendar_event');
  $role
    ->grantPermission('add any members to calendar event');
  $role
    ->save();
}