Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3280029
D12556.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
D12556.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
@@ -973,17 +973,6 @@
'Only visible to its members and admins of ancestor channels.',
};
-// 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: LegacyMemberInfo | MemberInfoWithPermissions | ServerMemberInfo,
-): boolean {
- if (memberInfo.minimallyEncoded) {
- return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE);
- }
- return !!memberInfo.permissions[threadPermissions.CHANGE_ROLE]?.value;
-}
-
function roleIsDefaultRole(
roleInfo: ?ClientLegacyRoleInfo | ?RoleInfo,
): boolean {
@@ -1026,16 +1015,6 @@
return !!_find({ name: 'Admins' })(threadInfo.roles);
}
-function threadOrParentThreadHasAdminRole(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo,
-) {
- return (
- threadMembersWithoutAddedAdmin(threadInfo).filter(member =>
- memberHasAdminPowers(member),
- ).length > 0
- );
-}
-
function identifyInvalidatedThreads(
updateInfos: $ReadOnlyArray<ClientUpdateInfo>,
): Set<string> {
@@ -1654,7 +1633,6 @@
threadInfoFromRawThreadInfo,
threadTypeDescriptions,
threadIsWithBlockedUserOnlyWithoutAdminRoleCheck,
- memberHasAdminPowers,
roleIsDefaultRole,
roleIsAdminRole,
threadHasAdminRole,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 8:58 AM (19 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2520891
Default Alt Text
D12556.diff (1 KB)
Attached To
Mode
D12556: [lib] Remove `threadOrParentThreadHasAdminRole` and `memberHadAdminPowers`
Attached
Detach File
Event Timeline
Log In to Comment