mirror of https://github.com/openclaw/openclaw.git
Gateway/Pairing: restore scope allow helper openclaw#20703 thanks @coygeek
This commit is contained in:
parent
9e3f96982e
commit
4f2c2ecef4
|
|
@ -177,6 +177,17 @@ function mergePendingDevicePairingRequest(
|
|||
};
|
||||
}
|
||||
|
||||
function scopesAllow(requested: string[], allowed: string[]): boolean {
|
||||
if (requested.length === 0) {
|
||||
return true;
|
||||
}
|
||||
if (allowed.length === 0) {
|
||||
return false;
|
||||
}
|
||||
const allowedSet = new Set(allowed);
|
||||
return requested.every((scope) => allowedSet.has(scope));
|
||||
}
|
||||
|
||||
const DEVICE_SCOPE_IMPLICATIONS: Readonly<Record<string, readonly string[]>> = {
|
||||
"operator.admin": ["operator.read", "operator.write", "operator.approvals", "operator.pairing"],
|
||||
"operator.write": ["operator.read"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue