0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-14 20:52:23 +00:00

Extracted permission building out of permission service

This commit is contained in:
Dan Brown 2022-07-12 19:38:11 +01:00
parent c5e9dfa168
commit 2d4f708c79
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
8 changed files with 463 additions and 500 deletions

View file

@ -3,7 +3,7 @@
namespace Database\Seeders;
use BookStack\Api\ApiToken;
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\Permissions\JointPermissionBuilder;
use BookStack\Auth\Permissions\RolePermission;
use BookStack\Auth\Role;
use BookStack\Auth\User;
@ -69,7 +69,7 @@ class DummyContentSeeder extends Seeder
]);
$token->save();
app(PermissionService::class)->buildJointPermissions();
app(JointPermissionBuilder::class)->buildJointPermissions();
app(SearchIndex::class)->indexAllEntities();
}
}

View file

@ -2,7 +2,7 @@
namespace Database\Seeders;
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\Permissions\JointPermissionBuilder;
use BookStack\Auth\Role;
use BookStack\Auth\User;
use BookStack\Entities\Models\Book;
@ -35,7 +35,7 @@ class LargeContentSeeder extends Seeder
$largeBook->chapters()->saveMany($chapters);
$all = array_merge([$largeBook], array_values($pages->all()), array_values($chapters->all()));
app()->make(PermissionService::class)->buildJointPermissionsForEntity($largeBook);
app()->make(JointPermissionBuilder::class)->buildJointPermissionsForEntity($largeBook);
app()->make(SearchIndex::class)->indexEntities($all);
}
}