コード例 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @param $file_id
  * @return Response
  */
 public function show($id, $file_id)
 {
     if ($this->service->checkProjectPermissions($file_id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->repository->find($file_id);
 }
コード例 #2
0
 /**
  * @param $projectFileId
  * @return mixed
  */
 private function checkProjectMember($projectFileId)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $this->repository->SkipPresenter()->find($projectFileId)->project_id;
     return $this->repository->hasMember($projectId, $userId);
 }