当前位置: 首页>>代码示例>>PHP>>正文


PHP Authorizer::getResourceOwnerId方法代码示例

本文整理汇总了PHP中Authorizer::getResourceOwnerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Authorizer::getResourceOwnerId方法的具体用法?PHP Authorizer::getResourceOwnerId怎么用?PHP Authorizer::getResourceOwnerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authorizer的用法示例。


在下文中一共展示了Authorizer::getResourceOwnerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $request->project;
     return $this->repository->isOwner($projectId, $userId) == false;
     return $next($request);
 }
开发者ID:alfredudu,项目名称:laravel_angular,代码行数:7,代码来源:CheckProjectOwner.php

示例2: index

 public function index(Request $request)
 {
     if ($request->query->get('project_type', 'owner') == 'owner') {
         return $this->repository->findOwner(\Authorizer::getResourceOwnerId(), $request->query->get('limit'));
     }
     return $this->repository->findMember(\Authorizer::getResourceOwnerId(), $request->query->get('limit'));
 }
开发者ID:vik0803,项目名称:project-manager-laravel,代码行数:7,代码来源:ProjectController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return $this->repository->findWhere(['owner_id' => \Authorizer::getResourceOwnerId()]);
     //return $this->repository->findWithOwnerAndMember(Authorizer::getResourceOwnerId());
     //return $this->repository->all();
     //return $this->repository->with(['client', 'user'])->all();
 }
开发者ID:robinhodemorais,项目名称:laravel_codeproject,代码行数:12,代码来源:ProjectController.php

示例4: getAuthUserId

 /**
  * Retorna o user logado no OAuth
  * @return int
  * @throws \Exception
  */
 protected function getAuthUserId()
 {
     $userId = \Authorizer::getResourceOwnerId();
     if (is_null($userId)) {
         $this->failedAuthorization();
     }
     return $userId;
 }
开发者ID:gdgfoz,项目名称:codelab-todo-api,代码行数:13,代码来源:BaseRequest.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     //return $this->repository->findWhere(['owner_id' => \Authorizer::getResourceOwnerId()]);
     //return $this->repository->findWithOwnerAndMember(\Authorizer::getResourceOwnerId());
     return $this->repository->findOwner(\Authorizer::getResourceOwnerId(), $request->query->get('limit'));
     //return $this->repository->all();
     //return $this->repository->with(['client', 'user'])->all();
 }
开发者ID:estevesklein,项目名称:CodeProject-curso-laravel,代码行数:13,代码来源:ProjectController.php

示例6: all

 public function all($limit = null)
 {
     try {
         return $this->repository->setPresenter($this->presenter)->findWithOwnerAndMember(\Authorizer::getResourceOwnerId(), $limit);
     } catch (\Exception $e) {
         return ["error" => true, "message" => 'Nenhum registro encontrado.', "messageDev" => $e->getMessage()];
     }
 }
开发者ID:jonasleitep4,项目名称:curso-laravel-angular,代码行数:8,代码来源:ProjectService.php

示例7: handle

 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $request->project;
     if ($this->repository->isOwner($id, $userId) == false) {
         return ['error' => 'Access forbidden'];
     }
 }
开发者ID:90lucasgabriel,项目名称:activity,代码行数:8,代码来源:CheckProjectOwner.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projeto = $request->projeto;
     if ($this->repository->isOwner($projeto, $userId) == false) {
         return ['error' => 'Access Forbbiden'];
     }
     return $next($request);
 }
开发者ID:igorfaria06,项目名称:laravel,代码行数:16,代码来源:ChecarDonoProjeto.php

示例9: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $request->projects;
     if ($this->repository->isOwner($projectId, $userId) == false) {
         return ['error' => 'Access denied! You must be the project owner to access this resource'];
     }
     return $next($request);
 }
开发者ID:emersonrodrigod,项目名称:codeproject,代码行数:16,代码来源:CheckProjectOwner.php

示例10: store

 public function store(Requests\CheckoutRequest $request)
 {
     $data = $request->all();
     $id = \Authorizer::getResourceOwnerId();
     $clientId = $this->userRepository->find($id)->client->id;
     $data['client_id'] = $clientId;
     $order = $this->service->create($data);
     return $this->repository->with($this->with)->find($order->id);
 }
开发者ID:nagahshi,项目名称:Laravel-CodeDelivery,代码行数:9,代码来源:ClientCheckoutController.php

示例11: handle

 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $project_id = $request->id;
     if (!$this->repository->isOwner($userId, $project_id)) {
         return ['error' => 'Access forbiden!'];
     }
     return $next($request);
 }
开发者ID:marioAquinoJF,项目名称:laravelWithAngular,代码行数:9,代码来源:CheckProjectOwner.php

示例12: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $request->project;
     if ($this->repository->isOwner($projectId, $userId) == false) {
         return ['error' => "Acesso negado"];
     }
     return $next($request);
 }
开发者ID:lucasinoue,项目名称:projeto,代码行数:16,代码来源:CheckProjectOwner.php

示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userId = \Authorizer::getResourceOwnerId();
     $projectId = $request->project;
     if ($this->service->isOwner($projectId, $userId) == false) {
         return ['sucess' => false];
     }
     return $next($request);
 }
开发者ID:heitorluz,项目名称:codeproject,代码行数:16,代码来源:CheckProjectOwner.php

示例14: projectsMember

 public function projectsMember(Request $request)
 {
     try {
         return $this->repository->findMember(\Authorizer::getResourceOwnerId(), $request->query->get('limit'));
     } catch (NoActiveAccessTokenException $e) {
         return $this->erroMsgm('Usuário não está logado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao listar os projetos. Erro: ' . $e->getMessage());
     }
 }
开发者ID:Talles-Gazel,项目名称:curso-Laravel5.1-AngularJS,代码行数:10,代码来源:ProjectController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     try {
         return $this->repository->with(['owner', 'client'])->findWhere(['owner_id' => \Authorizer::getResourceOwnerId()]);
     } catch (NoActiveAccessTokenException $e) {
         return $this->erroMsgm('Usuário não está logado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao listar os projetos. Erro: ' . $e->getMessage());
     }
 }
开发者ID:maiconmarioto,项目名称:CodeProject,代码行数:15,代码来源:ProjectController.php


注:本文中的Authorizer::getResourceOwnerId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。