Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3323033
D13014.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13014.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13014: [lib] Filter permission strings with member_ prefix for non-members
Attached
Detach File
Event Timeline
Log In to Comment