You are here

public function Drupal7Backend::permission_savePermission in Configuration Management 7.3

Overrides BackendInterface::permission_savePermission

File

src/Backends/Drupal7Backend.php, line 291

Class

Drupal7Backend

Namespace

Configuration\Backends

Code

public function permission_savePermission($permission) {
  $fields = array();
  foreach ($permission['roles'] as $role) {
    $fields[] = array(
      'rid' => $this->roles_ids[$role],
      'permission' => $permission['permission'],
      'module' => $permission['module'],
    );
  }
  if (!empty($fields)) {

    // Grant access only to the roles defined
    return db_insert('role_permission')
      ->fields($fields)
      ->execute();
  }
}