Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357839
D6928.id24846.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6928.id24846.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6928: [keyserver] Introduce a new thread permission for pinning / unpinning messages
Attached
Detach File
Event Timeline
Log In to Comment