Page MenuHomePhabricator

D7127.diff
No OneTemporary

D7127.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
@@ -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
@@ -275,6 +275,7 @@
);
},
],
+ [23, 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

Mime Type
text/plain
Expires
Wed, Nov 27, 11:40 AM (20 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590312
Default Alt Text
D7127.diff (3 KB)

Event Timeline