We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e84c63 commit 96016a2Copy full SHA for 96016a2
1 file changed
src/Traits/User.php
@@ -104,19 +104,20 @@ public function isSuper()
104
* @return void
105
*/
106
public function getAllPermissions(): Collection
107
- {
+ {
108
// 超级管理员 默认全部规则
109
if ($this->isSuper()) {
110
- return Permission::select();
+ return Permission::select();
111
}
112
113
$permissions = [];
114
-
+
115
foreach ($this->roles as $role) {
116
$permissions = array_unique(array_merge($permissions, $role->permissions->column('name')));
117
118
119
$permissions = Permission::whereIn('name', implode(',', $permissions))->select();
120
121
return $permissions;
122
123
0 commit comments