Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3323354
D13016.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
D13016.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
@@ -65,6 +65,17 @@
return { permission, propagationPrefix, filterPrefix, membershipPrefix };
}
+function constructThreadPermissionString(
+ parsed: ParsedThreadPermissionString,
+): string {
+ const propagationPrefix = parsed.propagationPrefix ?? '';
+ const filterPrefix = parsed.filterPrefix ?? '';
+ const membershipPrefix = parsed.membershipPrefix ?? '';
+ return (
+ propagationPrefix + filterPrefix + membershipPrefix + parsed.permission
+ );
+}
+
function includeThreadPermissionForThreadType(
parsed: ParsedThreadPermissionString,
threadType: ThreadType,
@@ -93,4 +104,8 @@
return true;
}
-export { parseThreadPermissionString, includeThreadPermissionForThreadType };
+export {
+ parseThreadPermissionString,
+ constructThreadPermissionString,
+ includeThreadPermissionForThreadType,
+};
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
@@ -4,6 +4,7 @@
import {
parseThreadPermissionString,
+ constructThreadPermissionString,
includeThreadPermissionForThreadType,
} from './prefixes.js';
import {
@@ -168,10 +169,11 @@
) {
permissionsForChildren[permissionKey] = permissionValue;
}
- const permissionWithFilterPrefix = parsed.filterPrefix
- ? `${parsed.filterPrefix}${parsed.permission}`
- : parsed.permission;
- permissionsForChildren[permissionWithFilterPrefix] = permissionValue;
+ const withoutPropagationPrefix = constructThreadPermissionString({
+ ...parsed,
+ propagationPrefix: null,
+ });
+ permissionsForChildren[withoutPropagationPrefix] = permissionValue;
}
if (Object.keys(permissionsForChildren).length === 0) {
return null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 3:40 AM (18 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2552233
Default Alt Text
D13016.diff (1 KB)
Attached To
Mode
D13016: [lib] Don't clear member_ prefix when propagating permissions to children
Attached
Detach File
Event Timeline
Log In to Comment