通过使用这个https://github.com/jeremykenedy/laravel-roles包,我使用了中间件的角色。
在示例中,有没有使用role或role来代替role和role的方法:
$this->middleware('auth');
$this->middleware(['role:basic', 'role:admin']);我能看到的唯一方法是将权限设置为:
canUseIndexMethodInTestController
canUseShowMethodInTestController然后将权限授予这两个角色。
是否已经为角色或角色预留了空间?
发布于 2019-08-28 19:06:07
你可以像$this->middleware(['role:basic|admin']);那样做
这也适用于this package。
https://stackoverflow.com/questions/57688422
复制相似问题