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


PHP Authorizer类代码示例

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


在下文中一共展示了Authorizer类的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: 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

示例5: 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

示例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: 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

示例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();
     $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

示例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->project;
     if ($this->repository->isOwner($projectId, $userId) == false) {
         return ['error' => "Acesso negado"];
     }
     return $next($request);
 }
开发者ID:lucasinoue,项目名称:projeto,代码行数: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

 /**
  * 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

示例12: logout

 /**
  * @author LAHAXE Arnaud
  *
  * @apiGroup Auth
  * @apiName logout
  * @api      {post} /oauth/logout Logout
  *
  * @return \Illuminate\Http\RedirectResponse|\Laravel\Lumen\Http\Redirector
  */
 public function logout()
 {
     /** @var TokenHelper $tokenHelper */
     $tokenHelper = \App::make(TokenHelper::class);
     $tokenHelper->deleteTokens(\Authorizer::getChecker()->getAccessToken()->getId());
     // reset session if some dev use session in a rest api :D
     \Session::flush();
     return response()->json([], 202);
 }
开发者ID:ndrx-io,项目名称:elude,代码行数:18,代码来源:Auth.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: 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

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $user_id = \Authorizer::getResourceOwnerId();
     $project_id = $request->project;
     $projects = $this->repository->skipPresenter()->findWhere(['id' => $project_id, 'owner_id' => $user_id]);
     if (count($projects) == false) {
         return ['error' => 'Access forbidden'];
     }
     return $next($request);
 }
开发者ID:phelippe,项目名称:CodeProject,代码行数:17,代码来源:CheckProjectOwner.php


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