Пример #1
0
 public function listresourcesandrightsAction()
 {
     $resources = [];
     $rights = [];
     if ($this->request->isPost()) {
         $roleId = $this->request->getPost('roleId', 0);
         $resources = $this->aclmodel->getResourceByRole($roleId);
         $rights = $this->aclmodel->getRightLists($roleId);
     }
     return new JsonModel(['resources' => $resources, 'rights' => $rights]);
 }
Пример #2
0
 /**
  * @dataProvider provideRoleResources
  */
 public function testGetResourceByRole($role, $result)
 {
     $this->assertEquals($result, $this->acl->getResourceByRole($role));
 }