1
0
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:
Dan Brown
2016-03-05 12:09:09 +00:00
parent 8e274a5a84
commit 268db6b1d0
9 changed files with 450 additions and 9 deletions

View File

@ -136,7 +136,7 @@ class BookRepo
*/
public function newFromInput($input)
{
return $this->bookQuery()->fill($input);
return $this->book->newInstance($input);
}
/**

View File

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