【发布时间】:2021-06-29 09:00:34
【问题描述】:
我正在使用 Laravel 8 和 Spatie 角色和权限。每个操作的权限都可以正常工作。但是,如果我将 delete action 权限分配给子管理员,但我直接从 URL middlware 中点击 create action 无法停止操作,因为用户没有创建权限。
public function __construct(CustomerInterface $customerInterface)
{
$this->customerInterface = $customerInterface;
$this->middleware(['permission:create_customer|delete_customer|edit_customer|chnage_customer_status']);
}
我在构造函数中使用上述中间件。我该如何解决这个问题。
【问题讨论】:
标签: laravel laravel-permission