Page MenuHomePhabricator

[native] [fix] Disable promoting user to admin option if there is no admin role in the thread
ClosedPublic

Authored by jacek on Mar 18 2022, 7:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 12:11 AM
Unknown Object (File)
Sun, Nov 10, 12:11 AM
Unknown Object (File)
Sun, Nov 10, 12:11 AM
Unknown Object (File)
Sun, Nov 10, 12:11 AM
Unknown Object (File)
Fri, Nov 8, 7:42 AM
Unknown Object (File)
Thu, Nov 7, 9:17 AM
Unknown Object (File)
Tue, Nov 5, 1:03 AM
Unknown Object (File)
Oct 4 2024, 10:41 AM

Details

Summary

Linear issue: https://linear.app/comm/issue/ENG-857/admin-sees-an-option-to-promote-user-to-an-admin-even-if-there-is-such
This update introduces additional condition, which disables "Make admin" (and "remove admin") options, when there is no "Admins" role in the thread.

Test Plan

Log in as admin (to have "change_role" permission) in mobile app. In community threads without admin role, the members menu doesn't contain "Make admin" item.
In "Genesis" thread (which contain "Admins" role, there is still an option to change admin permissions for user (e.g. downgrade Ashoat user role)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added a reviewer: ashoat.

I think this makes sense. It doesn't feel great to have this sort of logic in native (given I suspect we will need it in web as well), but I think we can handle "factoring it out" once we get to it on web.

This revision is now accepted and ready to land.Mar 21 2022, 8:08 AM