fix(authz): reserve role inheritance namespace
This commit is contained in:
@@ -26,6 +26,12 @@ describe("defineAuthz", () => {
|
||||
expect(() => defineAuthz({ permissions: { "post:*": {} } })).toThrow(/wildcard/i);
|
||||
});
|
||||
|
||||
test("rejects permission ids that collide with role inheritance", () => {
|
||||
expect(() => defineAuthz({ permissions: { "role:assign": {} } })).toThrow(
|
||||
/reserved 'role:' prefix/i,
|
||||
);
|
||||
});
|
||||
|
||||
test("rejects a role granting an unknown-shaped entry", () => {
|
||||
expect(() => defineAuthz({ roles: { editor: [""] } })).toThrow(/role 'editor'/i);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user