コード例 #1
0
ファイル: AppController.php プロジェクト: Vibeosys/RorderWeb
 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;
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: Vibeosys/RorderWeb
 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]);
 }