Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351356
D7127.id24209.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7127.id24209.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
@@ -107,6 +107,7 @@
const baseMemberPermissions = {
...genesisMemberPermissions,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.LEAVE_THREAD]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
[threadPermissions.ADD_MEMBERS]: true,
@@ -155,6 +156,7 @@
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.EDIT_ENTRIES]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
@@ -204,6 +206,7 @@
const memberPermissions = {
[threadPermissions.VOICED]: true,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
[threadPermissions.EDIT_THREAD_DESCRIPTION]: true,
@@ -227,6 +230,7 @@
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
[threadPermissions.EDIT_THREAD_DESCRIPTION]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
@@ -247,6 +251,7 @@
[threadPermissions.VISIBLE]: true,
[threadPermissions.VOICED]: true,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.EDIT_ENTRIES]: true,
[threadPermissions.EDIT_THREAD_NAME]: true,
[threadPermissions.EDIT_THREAD_COLOR]: true,
@@ -266,6 +271,7 @@
[threadPermissions.KNOW_OF]: true,
[threadPermissions.VISIBLE]: true,
[threadPermissions.REACT_TO_MESSAGE]: true,
+ [threadPermissions.EDIT_MESSAGE]: true,
[threadPermissions.CREATE_SIDEBARS]: true,
[threadPermissions.LEAVE_THREAD]: true,
[openDescendantKnowOf]: true,
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
@@ -100,6 +100,7 @@
CHANGE_ROLE: 'change_role',
LEAVE_THREAD: 'leave_thread',
REACT_TO_MESSAGE: 'react_to_message',
+ EDIT_MESSAGE: 'edit_message',
});
export type ThreadPermission = $Values<typeof threadPermissions>;
export function assertThreadPermissions(
@@ -123,7 +124,8 @@
ourThreadPermissions === 'remove_members' ||
ourThreadPermissions === 'change_role' ||
ourThreadPermissions === 'leave_thread' ||
- ourThreadPermissions === 'react_to_message',
+ ourThreadPermissions === 'react_to_message' ||
+ ourThreadPermissions === 'edit_message',
'string is not threadPermissions enum',
);
return ourThreadPermissions;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 1:11 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573375
Default Alt Text
D7127.id24209.diff (3 KB)
Attached To
Mode
D7127: [lib][keyserver] Introduce new threadPermissions types for editing messages
Attached
Detach File
Event Timeline
Log In to Comment