mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -13,10 +13,16 @@ export function resolveCommandAuthorizedFromAuthorizers(params: {
|
||||
const { useAccessGroups, authorizers } = params;
|
||||
const mode = params.modeWhenAccessGroupsOff ?? "allow";
|
||||
if (!useAccessGroups) {
|
||||
if (mode === "allow") return true;
|
||||
if (mode === "deny") return false;
|
||||
if (mode === "allow") {
|
||||
return true;
|
||||
}
|
||||
if (mode === "deny") {
|
||||
return false;
|
||||
}
|
||||
const anyConfigured = authorizers.some((entry) => entry.configured);
|
||||
if (!anyConfigured) return true;
|
||||
if (!anyConfigured) {
|
||||
return true;
|
||||
}
|
||||
return authorizers.some((entry) => entry.configured && entry.allowed);
|
||||
}
|
||||
return authorizers.some((entry) => entry.configured && entry.allowed);
|
||||
|
||||
Reference in New Issue
Block a user