如何在控制器的构造方法上添加或添加多个门权限
我正在与Laravel 5.8合作,并且在控制器中创建了此方法:
public function __construct()
{
$this->middleware('can:see-brand-requests')->only(['index']);
}
现在我需要说如果用户拥有这些权限之一,则显示index
方法:
brand-owner-info,brand-overall-info,brand-employees-info,brand-actions,see-brand-requests
那么我该如何添加或中间这个情况是中间软件?
I'm working with Laravel 5.8 and I have created this method in the Controller:
public function __construct()
{
$this->middleware('can:see-brand-requests')->only(['index']);
}
Now I need to say if user has one of these permissions, the show the index
method:
brand-owner-info,brand-overall-info,brand-employees-info,brand-actions,see-brand-requests
So how can I add OR in this case to the Middleware?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做以下操作。
在此处查找更多信息:
<
You can do something like the following.
Find out more information here:
https://laravel.com/docs/9.x/authorization.