當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。