userSession->isLogged()) { $this->checkProjectPermission($class, $method, $project_id); } } protected function checkProjectPermission($class, $method, $project_id) { if (empty($project_id)) { throw new AccessDeniedException('Project not found'); } $role = $this->projectUserRoleModel->getUserRole($project_id, $this->userSession->getId()); if (! $this->apiProjectAuthorization->isAllowed($class, $method, $role)) { throw new AccessDeniedException('Project access denied'); } } }