mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Migrated remaining relation permission usages
Now all tests are passing. Some level of manual checks to do.
This commit is contained in:
@ -29,7 +29,7 @@ class RegeneratePermissionsCommandTest extends TestCase
|
||||
'entity_id' => $page->id,
|
||||
'entity_type' => 'page',
|
||||
'role_id' => $role->id,
|
||||
'has_permission' => 1,
|
||||
'status' => 3, // Explicit allow
|
||||
]);
|
||||
|
||||
$page->permissions()->delete();
|
||||
|
@ -663,7 +663,7 @@ class EntityPermissionsTest extends TestCase
|
||||
$chapter = $this->entities->chapter();
|
||||
$book = $chapter->book;
|
||||
|
||||
$this->permissions->setEntityPermissions($book, ['edit'], [$viewerRole], false);
|
||||
$this->permissions->setEntityPermissions($book, ['update'], [$viewerRole], false);
|
||||
$this->permissions->setEntityPermissions($chapter, [], [$viewerRole], true);
|
||||
|
||||
$this->assertFalse(userCan('chapter-update', $chapter));
|
||||
@ -678,9 +678,10 @@ class EntityPermissionsTest extends TestCase
|
||||
$chapter = $this->entities->chapter();
|
||||
$book = $chapter->book;
|
||||
|
||||
$this->permissions->setEntityPermissions($book, ['edit'], [$editorRole], false);
|
||||
$this->permissions->setEntityPermissions($book, ['update'], [$editorRole], false);
|
||||
$this->permissions->setEntityPermissions($chapter, [], [$viewerRole], true);
|
||||
|
||||
$this->actingAs($user);
|
||||
$this->assertTrue(userCan('chapter-update', $chapter));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user