Page MenuHomePhabricator

D6928.id23876.diff
No OneTemporary

D6928.id23876.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
@@ -149,6 +149,7 @@
DESCENDANT + threadPermissions.EDIT_PERMISSIONS;
const descendantRemoveMembers = DESCENDANT + threadPermissions.REMOVE_MEMBERS;
const descendantChangeRole = DESCENDANT + threadPermissions.CHANGE_ROLE;
+ const descendantManagePins = DESCENDANT + threadPermissions.MANAGE_PINS;
const baseAdminPermissions = {
[threadPermissions.KNOW_OF]: true,
@@ -165,6 +166,7 @@
[threadPermissions.DELETE_THREAD]: true,
[threadPermissions.REMOVE_MEMBERS]: true,
[threadPermissions.CHANGE_ROLE]: true,
+ [threadPermissions.MANAGE_PINS]: true,
[descendantKnowOf]: true,
[descendantVisible]: true,
[topLevelDescendantJoinThread]: true,
@@ -181,6 +183,7 @@
[descendantEditPermissions]: true,
[descendantRemoveMembers]: true,
[descendantChangeRole]: true,
+ [descendantManagePins]: true,
};
let adminPermissions;
diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -227,6 +227,7 @@
`);
},
],
+ [22, updateRolesAndPermissionsForAllThreads],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js
--- a/lib/types/thread-types.js
+++ b/lib/types/thread-types.js
@@ -99,6 +99,7 @@
CHANGE_ROLE: 'change_role',
LEAVE_THREAD: 'leave_thread',
REACT_TO_MESSAGE: 'react_to_message',
+ MANAGE_PINS: 'manage_pins',
});
export type ThreadPermission = $Values<typeof threadPermissions>;
export function assertThreadPermissions(
@@ -122,7 +123,8 @@
ourThreadPermissions === 'remove_members' ||
ourThreadPermissions === 'change_role' ||
ourThreadPermissions === 'leave_thread' ||
- ourThreadPermissions === 'react_to_message',
+ ourThreadPermissions === 'react_to_message' ||
+ ourThreadPermissions === 'manage_pins',
'string is not threadPermissions enum',
);
return ourThreadPermissions;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 1:24 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577920
Default Alt Text
D6928.id23876.diff (2 KB)

Event Timeline