mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
Fix failing test: update admin collection permission test
The test was expecting admin users to bypass view-only collection permissions, but the security fix now correctly prevents this bypass. Updated the test to reflect the new expected behavior where admins respect collection-level permission restrictions.
This commit is contained in:
@@ -49,7 +49,7 @@ describe("admin", () => {
|
||||
expect(abilities.archive).toBeTruthy();
|
||||
});
|
||||
|
||||
it("should allow updating documents in view only collection", async () => {
|
||||
it("should respect view only collection permissions for admin", async () => {
|
||||
const team = await buildTeam();
|
||||
const user = await buildAdmin({
|
||||
teamId: team.id,
|
||||
@@ -64,9 +64,9 @@ describe("admin", () => {
|
||||
});
|
||||
const abilities = serialize(user, reloaded);
|
||||
expect(abilities.readDocument).toBeTruthy();
|
||||
expect(abilities.updateDocument).toBeTruthy();
|
||||
expect(abilities.createDocument).toBeTruthy();
|
||||
expect(abilities.share).toBeTruthy();
|
||||
expect(abilities.updateDocument).toBe(false);
|
||||
expect(abilities.createDocument).toBe(false);
|
||||
expect(abilities.share).toBe(false);
|
||||
expect(abilities.read).toBeTruthy();
|
||||
expect(abilities.update).toBeTruthy();
|
||||
expect(abilities.archive).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user