mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Fixed short editor in firefox and optimised some queries
Optimised permission fetching so that it won't initialise a bunch of models for the role permissions and instead does a manual query to get the data directly.
This commit is contained in:
@ -179,15 +179,13 @@ trait SharedTestHelpers
|
||||
|
||||
/**
|
||||
* Give the given user some permissions.
|
||||
* @param User $user
|
||||
* @param array $permissions
|
||||
*/
|
||||
protected function giveUserPermissions(User $user, $permissions = [])
|
||||
protected function giveUserPermissions(User $user, array $permissions = [])
|
||||
{
|
||||
$newRole = $this->createNewRole($permissions);
|
||||
$user->attachRole($newRole);
|
||||
$user->load('roles');
|
||||
$user->permissions(false);
|
||||
$user->clearPermissionCache();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user