Page MenuHomePhabricator

D6928.id24846.diff
No OneTemporary

D6928.id24846.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
@@ -153,6 +153,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,
@@ -171,6 +172,7 @@
[threadPermissions.DELETE_THREAD]: true,
[threadPermissions.REMOVE_MEMBERS]: true,
[threadPermissions.CHANGE_ROLE]: true,
+ [threadPermissions.MANAGE_PINS]: true,
[descendantKnowOf]: true,
[descendantVisible]: true,
[topLevelDescendantJoinThread]: true,
@@ -188,6 +190,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
@@ -318,6 +318,7 @@
`);
},
],
+ [29, 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
@@ -106,6 +106,7 @@
REACT_TO_MESSAGE: 'react_to_message',
EDIT_MESSAGE: 'edit_message',
EDIT_THREAD_AVATAR: 'edit_thread_avatar',
+ MANAGE_PINS: 'manage_pins',
});
export type ThreadPermission = $Values<typeof threadPermissions>;
export function assertThreadPermissions(
@@ -131,7 +132,8 @@
ourThreadPermissions === 'leave_thread' ||
ourThreadPermissions === 'react_to_message' ||
ourThreadPermissions === 'edit_message' ||
- ourThreadPermissions === 'edit_thread_avatar',
+ ourThreadPermissions === 'edit_thread_avatar' ||
+ ourThreadPermissions === 'manage_pins',
'string is not threadPermissions enum',
);
return ourThreadPermissions;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 1:52 AM (20 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577724
Default Alt Text
D6928.id24846.diff (2 KB)

Event Timeline