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


PHP Authorizer::getResourceOwnerId方法代码示例

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


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

示例1: store

 public function store(array $data)
 {
     try {
         $userId = Authorizer::getResourceOwnerId();
         $this->user = $this->repository->find($userId);
         $data['cliente_id'] = $this->user->cliente_id;
         //$this->validator->with($data)->passesOrFail();
         //Verificando se email existeformlogin
         $usuario = $this->repository->findWhere(['cliente_id' => $data['cliente_id'], 'email' => $data['email']]);
         if ($usuario->count()) {
             return ['warning' => true, 'message' => 'Email já cadastrado!'];
         }
         $data['token_senha'] = str_random(60);
         $this->repository->create($data);
         $data['link'] = 'www.teste.proload.com.br/#/acesso/' . $data['token_senha'];
         Mail::send('email.bemvindo', ['dado' => $data], function ($m) use($data) {
             $m->to($data['email'], $data['name'])->subject('Bem vindo ao ProDmed');
         });
         return ['success' => true, 'message' => 'Usuário cadastrado com sucesso!'];
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     } catch (QueryException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
开发者ID:jaysongyn,项目名称:dmed,代码行数:25,代码来源:UserService.php

示例2: handle

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

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, $role)
 {
     $user = $this->userRepository->skipPresenter()->find(Authorizer::getResourceOwnerId());
     if ($user->role != $role) {
         abort(403, 'Access forbidden');
     }
     return $next($request);
 }
开发者ID:adrianodrix,项目名称:codedelivery.dev,代码行数:15,代码来源:OAuthCheckRole.php

示例4: store

 public function store(CheckoutRequest $request)
 {
     $data = $request->all();
     $client = $this->userRepository->find(Authorizer::getResourceOwnerId())->client->id;
     $data['client_id'] = $client;
     $order = $this->orderService->create($data);
     return $this->orderRepository->skipPresenter(false)->with($this->with)->find($order->id);
 }
开发者ID:ssistemas,项目名称:delivery,代码行数:8,代码来源:ClientCheckoutController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $deliverymanId = Authorizer::getResourceOwnerId();
     if ($order = $this->orderService->updateStatus($id, $deliverymanId, $request->get('status'))) {
         return $order;
     }
     abort(400, 'Pedido não encontrado');
 }
开发者ID:douglasresendemaciel,项目名称:laravel_delivery,代码行数:15,代码来源:DeliverymanCheckoutController.php

示例6: index

 public function index()
 {
     #$rtrn = $this->user_repository->skipPresenter()->find(Authorizer::getResourceOwnerId())->projects()->with(['client', 'tasks', 'notes', 'members', 'owner'])->get();
     $rtrn = $this->repository->findWithOwnerAndMember(Authorizer::getResourceOwnerId());
     #$rtrn = $this->user_repository->find(Authorizer::getResourceOwnerId())->projects()->with(['client', 'tasks', 'notes', 'members', 'owner'])->get();
     #return $this->user_repository->find(Authorizer::getResourceOwnerId())->projects()->with(['client', 'tasks', 'notes', 'members'])->get();
     return $rtrn;
 }
开发者ID:phelippe,项目名称:CodeProject,代码行数:8,代码来源:ProjectService.php

示例7: all

 public function all($id = null, $limit = 6)
 {
     $this->setPresenter();
     if (!is_null($id)) {
         return $this->repository->findWhere(['project_id' => $id]);
     }
     return $this->repository->recentTasks(Authorizer::getResourceOwnerId(), $limit);
 }
开发者ID:netoudi,项目名称:laravel-angularjs,代码行数:8,代码来源:ProjectTaskService.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $id = $request->id;
     if (!$this->repository->isOwner($id, Authorizer::getResourceOwnerId())) {
         return response()->json(['error' => true, 'message' => ['owner' => 'You are not an authorized user in this project']], 403);
     }
     return $next($request);
 }
开发者ID:brunowerneck,项目名称:CodeProject,代码行数:15,代码来源:CheckProjectOwner.php

示例9: store

 public function store(Request $request)
 {
     $id = Authorizer::getResourceOwnerId();
     $dados = $request->all();
     $cliente = $this->userRepository->find($id)->cliente->id;
     $dados['cliente_id'] = $cliente;
     $pedido = $this->pedidoService->criar($dados);
     return $this->repository->with('items')->find($pedido->id);
 }
开发者ID:rpc1910,项目名称:LaravelDelivery,代码行数:9,代码来源:ClientCarrinhoController.php

示例10: __construct

 /**
  * @param VendasRepository $repository
  * @param VendasService $service
  */
 public function __construct(VendasRepository $repository, VendasService $service, RevendedoresRepository $revendedoresRepository)
 {
     $this->repository = $repository;
     $this->service = $service;
     $this->revendedoresRepository = $revendedoresRepository;
     $userId = Authorizer::getResourceOwnerId();
     $revendedor = $this->revendedoresRepository->findWhere(['id_usuario' => $userId]);
     $this->id_revendedor = $revendedor[0]['id'];
 }
开发者ID:JhonnyHRocha,项目名称:lince,代码行数:13,代码来源:VendasController.php

示例11: checkPermissions

 public function checkPermissions($projectId)
 {
     $owner = $this->project->find($projectId)->owner_id;
     $userId = Authorizer::getResourceOwnerId();
     if ($owner != $userId and !$this->hasMember($projectId)) {
         throw new \Exception('Access Denied');
     }
     return true;
 }
开发者ID:cristianvuolo,项目名称:cursoLaravelAnguar,代码行数:9,代码来源:ProjectTaskController.php

示例12: updateStatus

 public function updateStatus(Request $request, $id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerId();
     $order = $this->service->updateStatus($id, $idDeliveryman, $request->get('status'));
     if ($order) {
         return $this->repository->find($order->id);
     }
     abort(400, "Order not found!");
 }
开发者ID:daniloesser,项目名称:codedelivery,代码行数:9,代码来源:DeliverymanCheckoutController.php

示例13: handle

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

示例14: 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:mvnp,项目名称:Projeto,代码行数:16,代码来源:CheckProjectOwner.php

示例15: geo

 public function geo(Request $request, Geo $geo, $id)
 {
     $idDeliveryman = Authorizer::getResourceOwnerId();
     $order = $this->orderRepository->getByIdAndDeliveryman($id, $idDeliveryman);
     $geo->lat = $request->get('lat');
     $geo->long = $request->get('long');
     event(new GetLocationDeliveryMan($geo, $order));
     return $geo;
 }
开发者ID:NiltonMorais,项目名称:laravel_codedelivery,代码行数:9,代码来源:DeliverymanCheckoutController.php


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