mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Added a whole load of permission & role tests
This commit is contained in:
@ -136,7 +136,7 @@ class BookRepo
|
||||
*/
|
||||
public function newFromInput($input)
|
||||
{
|
||||
return $this->bookQuery()->fill($input);
|
||||
return $this->book->newInstance($input);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,6 +101,7 @@ class PermissionsRepo
|
||||
public function assignRolePermissions(Role $role, $permissionNameArray = [])
|
||||
{
|
||||
$permissions = [];
|
||||
$permissionNameArray = array_values($permissionNameArray);
|
||||
if ($permissionNameArray && count($permissionNameArray) > 0) {
|
||||
$permissions = $this->permission->whereIn('name', $permissionNameArray)->pluck('id')->toArray();
|
||||
}
|
||||
|
Reference in New Issue
Block a user