Page MenuHomePhabricator

D13014.id.diff
No OneTemporary

D13014.id.diff

diff --git a/lib/permissions/prefixes.js b/lib/permissions/prefixes.js
--- a/lib/permissions/prefixes.js
+++ b/lib/permissions/prefixes.js
@@ -68,6 +68,7 @@
function includeThreadPermissionForThreadType(
parsed: ParsedThreadPermissionString,
threadType: ThreadType,
+ isMember: boolean,
): boolean {
if (
threadType !== threadTypes.COMMUNITY_OPEN_SUBTHREAD &&
@@ -83,6 +84,11 @@
parsed.filterPrefix === threadPermissionFilterPrefixes.OPEN_TOP_LEVEL)
) {
return false;
+ } else if (
+ !isMember &&
+ parsed.membershipPrefix === threadPermissionMembershipPrefixes.MEMBER
+ ) {
+ return false;
}
return true;
}
diff --git a/lib/permissions/thread-permissions.js b/lib/permissions/thread-permissions.js
--- a/lib/permissions/thread-permissions.js
+++ b/lib/permissions/thread-permissions.js
@@ -83,11 +83,13 @@
): ?ThreadPermissionsBlob {
let permissions: { [permission: string]: ThreadPermissionInfo } = {};
+ const isMember = !!rolePermissions;
+
if (permissionsFromParent) {
for (const permissionKey in permissionsFromParent) {
const permissionValue = permissionsFromParent[permissionKey];
const parsed = parseThreadPermissionString(permissionKey);
- if (!includeThreadPermissionForThreadType(parsed, threadType)) {
+ if (!includeThreadPermissionForThreadType(parsed, threadType, isMember)) {
continue;
}
if (parsed.propagationPrefix) {
@@ -127,7 +129,6 @@
(permissions: ThreadPermissionsBlob),
threadPermissions.VOICED_IN_ANNOUNCEMENT_CHANNELS,
);
- const isMember = !!rolePermissions;
if (
threadIsAnnouncementThread &&

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 2:44 AM (21 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2552231
Default Alt Text
D13014.id.diff (1 KB)

Event Timeline