本文整理汇总了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);
}
示例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'));
}
示例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();
}
示例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;
}
示例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();
}
示例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()];
}
}
示例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'];
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
}
示例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());
}
}