Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513262
D9953.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D9953.diff
View Options
diff --git a/lib/types/thread-permission-types.js b/lib/types/thread-permission-types.js
--- a/lib/types/thread-permission-types.js
+++ b/lib/types/thread-permission-types.js
@@ -310,31 +310,6 @@
[userSurfacedPermissions.MANAGE_INVITE_LINKS]: manageInviteLinksPermissions,
});
-export const universalCommunityPermissions: $ReadOnlyArray<string> = [
- // know_of | descendant_open_know_of
- threadPermissions.KNOW_OF,
- threadPermissionPropagationPrefixes.DESCENDANT +
- threadPermissionFilterPrefixes.OPEN +
- threadPermissions.KNOW_OF,
-
- // visible | descendant_open_visible
- threadPermissions.VISIBLE,
- threadPermissionPropagationPrefixes.DESCENDANT +
- threadPermissionFilterPrefixes.OPEN +
- threadPermissions.VISIBLE,
-
- // child_open_join_thread | descendant_opentoplevel_join_thread
- threadPermissionPropagationPrefixes.CHILD +
- threadPermissionFilterPrefixes.OPEN +
- threadPermissions.JOIN_THREAD,
- threadPermissionPropagationPrefixes.DESCENDANT +
- threadPermissionFilterPrefixes.OPEN_TOP_LEVEL +
- threadPermissions.JOIN_THREAD,
-
- threadPermissions.CREATE_SIDEBARS,
- threadPermissions.LEAVE_THREAD,
-];
-
export type ThreadPermissionInfo =
| { +value: true, +source: string }
| { +value: false, +source: null };
diff --git a/lib/types/thread-permission-types.test.js b/lib/types/thread-permission-types.test.js
--- a/lib/types/thread-permission-types.test.js
+++ b/lib/types/thread-permission-types.test.js
@@ -2,12 +2,7 @@
import _isEqual from 'lodash/fp/isEqual.js';
-import {
- configurableCommunityPermissions,
- universalCommunityPermissions,
- userSurfacedPermissions,
- threadPermissions,
-} from './thread-permission-types.js';
+import { userSurfacedPermissions } from './thread-permission-types.js';
import { getRolePermissionBlobs } from '../permissions/thread-permissions.js';
import { threadTypes } from '../types/thread-types-enum.js';
import { values } from '../utils/objects.js';
@@ -18,26 +13,6 @@
threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT,
);
- it('should find Member permissions from getRolePermissionBlobs and user-surfaced permissions to be equal', () => {
- const membersPermissionsConstructed = [
- ...configurableCommunityPermissions[userSurfacedPermissions.ADD_MEMBERS],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.REACT_TO_MESSAGES
- ],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.EDIT_MESSAGES
- ],
- ...universalCommunityPermissions,
- ];
- const membersPermissionsConstructedBlob = Object.fromEntries(
- membersPermissionsConstructed.map(permission => [permission, true]),
- );
-
- expect(
- _isEqual(membersPermissionBlob, membersPermissionsConstructedBlob),
- ).toBe(true);
- });
-
it('should find equal permission blobs when toggling user-surfaced permissions', () => {
for (const userSurfacedPermission of values(userSurfacedPermissions)) {
const firstTimeToggledPermissionSet = toggleUserSurfacedPermission(
@@ -61,33 +36,6 @@
threadTypes.COMMUNITY_ROOT,
);
- it('should find Member permissions from getRolePermissionBlobs and user-surfaced permissions to be equal', () => {
- const membersPermissionsConstructed = [
- ...configurableCommunityPermissions[userSurfacedPermissions.ADD_MEMBERS],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.REACT_TO_MESSAGES
- ],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.EDIT_MESSAGES
- ],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.CREATE_AND_EDIT_CHANNELS
- ],
- ...configurableCommunityPermissions[
- userSurfacedPermissions.EDIT_CALENDAR
- ],
- threadPermissions.VOICED,
- ...universalCommunityPermissions,
- ];
- const membersPermissionsConstructedBlob = Object.fromEntries(
- membersPermissionsConstructed.map(permission => [permission, true]),
- );
-
- expect(
- _isEqual(membersPermissionBlob, membersPermissionsConstructedBlob),
- ).toBe(true);
- });
-
it('should find equal permission blobs when toggling user-surfaced permissions', () => {
for (const userSurfacedPermission of values(userSurfacedPermissions)) {
const firstTimeToggledPermissionSet = toggleUserSurfacedPermission(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 11:28 PM (14 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692860
Default Alt Text
D9953.diff (4 KB)
Attached To
Mode
D9953: [lib] Delete the old universalCommunityPermissions set
Attached
Detach File
Event Timeline
Log In to Comment