public function isAuthorised($permissonSet, $permissionKey) { if ($permissonSet) { $userPermissions = explode('|', $permissonSet); $permissionSetController = new PermissionSetController(); $permissions = $permissionSetController->getPermissionsStdObj(); foreach ($userPermissions as $key => $value) { if ($permissions->{$value} == $permissionKey) { return true; } } } return FALSE; }
public function usersList() { if (!$this->isLogin()) { $this->redirect('login'); } $userRoleController = new UserRoleController(); $roles = $userRoleController->getUserRoleStdObj(); $permissionController = new PermissionSetController(); $permissions = $permissionController->getPermissionsStdObj(); $restaurantId = $this->readCookie('cri'); $userList = $this->getUsers($restaurantId); $this->set(['users' => $userList, 'roles' => $roles, 'permissions' => $permissions]); }