Exemplo n.º 1
0
 /**
  * @param array $input
  *
  * @return bool
  */
 public function updatePermissions(array $input)
 {
     $roles = $this->getRoles();
     $model = new RoleModel($this->db);
     foreach ($roles as $role) {
         if (isset($input[$role->getId()])) {
             $permissions = array_keys($input[$role->getId()]);
             $model->updatePermissions($role->getId(), $permissions);
         } else {
             $model->updatePermissions($role->getId(), array());
         }
     }
     return true;
 }