HomePhabricator
Diffusion Comm cd71e1fc65fe

[lib] Update `threadHasAdminRole` to consider `specialField`

Description

[lib] Update threadHasAdminRole to consider specialField

Summary:
Context: https://linear.app/comm/issue/ENG-6948/update-threadhasadminrole-to-use-specialrole-field

We're first going through to see if any role has specialRoles.ADMIN_ROLE. If one does, we return true. If one doesn't but has ANY specialRole fields, we assume that it is a Client/"current" type and return false.

However, if there is no specialRole field encountered, we will assume we're dealing with a Server/"legacy" type and fallback to sketchy string search.


Depends on D11208

Test Plan: Going to write some unit tests. Also logged return value at callsites and ensured that things continue to work as expected.

Reviewers: ginsu, tomek, kamil, michal

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D11209

Details

Provenance
atulAuthored on Mar 19 2024, 10:53 AM
Reviewer
tomek
Differential Revision
D11209: [lib] Update `threadHasAdminRole` to consider `specialField`
Parents
rCOMM49bcd23b617f: [lib] Deprecate `useRoleDeletableAndEditableStatus` and determine `is…
Branches
Unknown
Tags
Unknown