Page MenuHomePhabricator

D13016.id43233.diff
No OneTemporary

D13016.id43233.diff

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

Mime Type
text/plain
Expires
Thu, Nov 21, 3:43 AM (18 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2552233
Default Alt Text
D13016.id43233.diff (1 KB)

Event Timeline