Laravel 基于策略的条件授权

时间:2021-04-07 08:56:04

标签: php laravel authorization laravel-authorization laravel-controller

为了控制授权,我使用了以下内容

$this->authorize('show', $organization,\App\Organization::class);

$this->authorize('show', $garden,\App\Garden::class);

如何同时控制基于两者的授权?特别是,当某人无法访问基于此的权限时

$this->authorize('show', $organization,\App\Organization::class);

然后检查另一个

$this->authorize('show', $garden,\App\Garden::class);

并且只有当那个人也失败了,这个人才不能访问。

0 个答案:

没有答案