Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3523809
D9839.id33151.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
D9839.id33151.diff
View Options
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -943,7 +943,7 @@
}
function threadIsWithBlockedUserOnly(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
checkOnlyViewerBlock?: boolean,
@@ -975,7 +975,7 @@
}
function threadFrozenDueToBlock(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -983,7 +983,7 @@
}
function threadFrozenDueToViewerBlock(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1009,8 +1009,15 @@
// Since we don't have access to all of the ancestor ThreadInfos, we approximate
// "parent admin" as anybody with CHANGE_ROLE permissions.
function memberHasAdminPowers(
- memberInfo: RelativeMemberInfo | MemberInfo | ServerMemberInfo,
+ memberInfo:
+ | RelativeMemberInfo
+ | MemberInfo
+ | ServerMemberInfo
+ | MinimallyEncodedMemberInfo,
): boolean {
+ if (memberInfo.minimallyEncoded) {
+ return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE);
+ }
return !!memberInfo.permissions[threadPermissions.CHANGE_ROLE]?.value;
}
@@ -1035,7 +1042,7 @@
}
function threadOrParentThreadHasAdminRole(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
) {
return (
threadMembersWithoutAddedAshoat(threadInfo).filter(member =>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 10:21 AM (17 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698505
Default Alt Text
D9839.id33151.diff (1 KB)
Attached To
Mode
D9839: [lib] Update `memberHasAdminPowers` to handle `MinimallyEncodedMemberInfo`
Attached
Detach File
Event Timeline
Log In to Comment