• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Authorizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Authorizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


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


示例17: updateStatus

 /**
  * @param Request $request
  * @param $id
  * @return mixed
  */
 public function updateStatus(Request $request, $id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerID();
     $order = $this->orderService->updateStatus($id, $idDeliveryman, $request->get('status'));
     if ($order != false) {
         return $order;
     } else {
         abort(400, 'Order não encontrado');
     }
 }
开发者ID:gabrielcabral,项目名称:laravel-codedelivery,代码行数:15,代码来源:DeliverymanCheckoutController.php


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


示例19: generateToken

 public function generateToken()
 {
     try {
         $result = \Authorizer::issueAccessToken();
         \Session::set('token', array_get($result, 'access_token'));
         return redirect()->back();
     } catch (OAuthException $e) {
         return redirect()->with('error', $e->getMessage());
     }
 }
开发者ID:gdgfoz,项目名称:codelab-todo-api,代码行数:10,代码来源:DashboardController.php


示例20: login

 public function login(Request $request)
 {
     $input = $request->all();
     $return = \Authorizer::issueAccessToken();
     $AccessToken = new AccessToken();
     $user = $AccessToken->getData($return['access_token']);
     if ($user) {
         $me = $this->userRepository->getMe($user->id);
         $return['features'] = $me['features'];
     }
     return Response::json($return);
 }
开发者ID:ardiqghenatya,项目名称:koptel2,代码行数:12,代码来源:LoginAPIController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AutoLoader类代码示例发布时间:2022-05-23
下一篇:
PHP AuthorizationPolicy类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap