domain: permission: filter out placeholder bit

This commit is contained in:
undefined committed 2026-03-25 20:52:21 +08:00
1 parent 5c119768e1
commit 949c990a4a
1 file changed
+5 -2
+5 -2
View File
@@ -224,7 +224,10 @@ class DomainPermissionHandler extends ManageHandler {
: (typeof list === 'object' && list)
? Object.values(list) : [list];
roles[role] = 0n;
for (const r of perms) roles[role] |= 1n << BigInt(r);
for (const r of perms) {
if (+r === 1000) continue; // skip placeholder value
roles[role] |= 1n << BigInt(r);
}
}
await Promise.all([
domain.setRoles(domainId, roles),
@@ -391,7 +394,7 @@ class DomainJoinHandler extends Handler {
const groups = await user.listGroup(target);
const entry = groups.find((i) => i.name === this.joinSettings.group);
if (!entry) throw new ValidationError('group');
await user.updateGroup(target, entry.name, entry.uids.concat(this.user._id));
await user.updateGroup(target, entry.name, [...entry.uids, this.user._id]);
}
await Promise.all([
domain.setUserInDomain(target, this.user._id, {