Closed xlkit456852 closed 8 years ago
Maybe this block
return $this->getPermissions()->contains(function ($value, $key) use ($permission) {
return $permission == $value->id || Str::is($permission, $value->slug);
});
should be replace by this
return $this->getPermissions()->contains(function ($value, $key) use ($permission) {
return $permission == $value->id || $permission == $value->slug;
});
Bican\Roles\Traits\HasRoleAndPermission I'm guessing.
I figured out this. Because rolePermissions() has this "->orWhere('roles.level', '<', $this->level())" condition,and my super admin 's level(1) is lower than normal admin(2)....Now I set my super admin level 100
@xlkit456852 is the issue resolved?
yes,resolved.
@xlkit456852 Don't you mind to close the issue then?
1、User -- Roles admin(id=1) -- super.admin test(id=2) -- admin
2、Role -- Permission super.admin -- admin.manage
but I run: $user = User::find(2); dd($user->can('admin.manage')); it returns true?