mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
Permissions: Updated guest user handling so additional roles apply
Previously additional roles would only partially apply (system or "all" permissions). This aligns the query-handling of permissions so that additional roles will be used for permission queries. Adds migration to detach existing roles as a safety precaution since this is likely to widen permissions in scenarios that the public user has other roles assigned already. For #1229
This commit is contained in:
@@ -183,10 +183,6 @@ class PermissionApplicator
|
||||
*/
|
||||
protected function getCurrentUserRoleIds(): array
|
||||
{
|
||||
if (auth()->guest()) {
|
||||
return [Role::getSystemRole('public')->id];
|
||||
}
|
||||
|
||||
return $this->currentUser()->roles->pluck('id')->values()->all();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user