mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 09:10:20 +00:00
fix(pairing): treat operator.admin as satisfying operator.write
This commit is contained in:
@@ -26,14 +26,21 @@ describe("roleScopesAllow", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps non-read operator scopes explicit", () => {
|
||||
it("treats operator.write as satisfied by write/admin scopes", () => {
|
||||
expect(
|
||||
roleScopesAllow({
|
||||
role: "operator",
|
||||
requestedScopes: ["operator.write"],
|
||||
allowedScopes: ["operator.write"],
|
||||
}),
|
||||
).toBe(true);
|
||||
expect(
|
||||
roleScopesAllow({
|
||||
role: "operator",
|
||||
requestedScopes: ["operator.write"],
|
||||
allowedScopes: ["operator.admin"],
|
||||
}),
|
||||
).toBe(false);
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("uses strict matching for non-operator roles", () => {
|
||||
|
||||
Reference in New Issue
Block a user