/**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @param  int $memberId
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id, $memberId)
 {
     if ($this->service->checkProjectPermissions($id) == false) {
         return ['error' => 'Access forbidden'];
     }
     $this->service->removeMember($id, $memberId);
 }
 /**
  * Remove a project member
  * @param  Request $request form request
  * @param  integer  $id      project id
  * @param  integer  $userId  user id
  * @return Response
  */
 public function removeMember(Request $request, $id, $userId)
 {
     if (!$this->service->checkProjectOwner($id)) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->service->removeMember($id, $userId);
 }
 public function removeMember($projectId, $memberId)
 {
     try {
         $this->checkPermissions($projectId);
         $this->service->removeMember($projectId, $memberId);
     } catch (\Exception $e) {
         return ['error' => $e->getMessage()];
     }
 }
 public function removeMember($project_id, $member_id)
 {
     try {
         return $this->service->removeMember($project_id, $member_id);
     } catch (ModelNotFoundException $e) {
         return $this->erroMsgm('Projeto não encontrado.');
     } catch (QueryException $e) {
         return $this->erroMsgm('Cliente não encontrado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao remover o membro.');
     }
 }
 public function removeMember($project_id, $member_id)
 {
     try {
         if (!$this->service->checkProjectOwner($project_id)) {
             return $this->erroMsgm("O usuário não é owner desse projeto");
         }
         return $this->service->removeMember($project_id, $member_id);
     } catch (ModelNotFoundException $e) {
         return $this->erroMsgm('Projeto não encontrado.');
     } catch (QueryException $e) {
         return $this->erroMsgm('Cliente não encontrado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao remover o membro.');
     }
 }
 public function removeMember($id, $id_user)
 {
     return $this->service->removeMember($id, $id_user);
 }
 /**
  * @param $id
  * @param $memberId
  * @return Response
  */
 public function removeMember($id, $memberId)
 {
     return $this->service->removeMember($id, $memberId);
 }
 /**
  * @param $projectId
  * @param $memberId
  * @return array
  */
 public function delete($projectId, $memberId)
 {
     return $this->service->removeMember($projectId, $memberId);
 }
Ejemplo n.º 9
0
 public function destroyMember($project_id, $member_id)
 {
     return $this->service->removeMember($project_id, $member_id);
 }