users: Use role value directly to display user role text in frontend.

Since, we now get role value in person objects sent from server, we
can simply user user_role_map to display role in different places
instead of having multiple if-else conditions to check flags like
is_admin, is_guest, etc.
This commit is contained in:
sahil839
2021-04-29 19:19:01 +05:30
committed by Tim Abbott
parent 4f354e28eb
commit 77499589f9
7 changed files with 14 additions and 34 deletions

View File

@@ -239,9 +239,7 @@ function human_info(person) {
const info = {};
info.is_bot = false;
info.is_admin = person.is_admin;
info.is_guest = person.is_guest;
info.is_owner = person.is_owner;
info.user_role_text = people.get_user_type(person.user_id);
info.is_active = people.is_person_active(person.user_id);
info.user_id = person.user_id;
info.full_name = person.full_name;