Page MenuHomePhabricator

D9974.id33726.diff
No OneTemporary

D9974.id33726.diff

diff --git a/keyserver/src/creators/role-creator.js b/keyserver/src/creators/role-creator.js
--- a/keyserver/src/creators/role-creator.js
+++ b/keyserver/src/creators/role-creator.js
@@ -1,5 +1,6 @@
// @flow
+import { defaultSpecialRoles } from 'lib/permissions/special-roles.js';
import {
getRolePermissionBlobs,
getThreadPermissionBlobFromUserSurfacedPermissions,
@@ -50,11 +51,13 @@
const id = ids.shift();
namesToIDs[name] = id;
const permissionsBlob = JSON.stringify(rolePermissions[name]);
- newRows.push([id, threadID, name, permissionsBlob, time]);
+ const specialRole = defaultSpecialRoles[name] ?? null;
+ newRows.push([id, threadID, name, permissionsBlob, time, specialRole]);
}
const query = SQL`
- INSERT INTO roles (id, thread, name, permissions, creation_time)
+ INSERT INTO roles (id, thread, name,
+ permissions, creation_time, special_role)
VALUES ${newRows}
`;
await dbQuery(query);
diff --git a/lib/permissions/special-roles.js b/lib/permissions/special-roles.js
--- a/lib/permissions/special-roles.js
+++ b/lib/permissions/special-roles.js
@@ -3,3 +3,7 @@
export const specialRoles = Object.freeze({
DEFAULT_ROLE: 1,
});
+
+export const defaultSpecialRoles = Object.freeze({
+ Members: specialRoles.DEFAULT_ROLE,
+});

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 10:58 PM (19 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608873
Default Alt Text
D9974.id33726.diff (1 KB)

Event Timeline