1
0
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:
Dan Brown
2021-01-02 01:22:41 +00:00
parent 857d9ed3f1
commit 588fd7d165
5 changed files with 46 additions and 30 deletions

View File

@ -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();
}
/**