From 061c679808656d37d66c0f7adad03b23da04db5e Mon Sep 17 00:00:00 2001 From: Tom Bishop Date: Wed, 24 Jul 2024 11:07:49 -0400 Subject: [PATCH] CLDR-14788 Hide TC and manager level menu items from vetters (#3871) --- tools/cldr-apps/js/src/esm/cldrAccount.mjs | 10 ++++++-- tools/cldr-apps/js/src/views/MainMenu.vue | 24 ++++++++++++++----- .../java/org/unicode/cldr/web/SurveyAjax.java | 2 +- .../org/unicode/cldr/web/TestUserLevel.csv | 2 +- .../org/unicode/cldr/util/VoteResolver.java | 2 +- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/tools/cldr-apps/js/src/esm/cldrAccount.mjs b/tools/cldr-apps/js/src/esm/cldrAccount.mjs index db78f60c6de..ea198dc4451 100644 --- a/tools/cldr-apps/js/src/esm/cldrAccount.mjs +++ b/tools/cldr-apps/js/src/esm/cldrAccount.mjs @@ -270,7 +270,7 @@ function getHtml(json) { html += getOrgFilterMenu(); } } - if (justUser) { + if (justUser && canListMultipleUsers()) { html += "

" + listMultipleUsersButton + "

\n"; } if (!isJustMe) { @@ -345,7 +345,9 @@ function getTableStart() { function getTableEnd(json) { let html = "" + "
\n"; if (justUser) { - html += listMultipleUsersButton; + if (canListMultipleUsers()) { + html += listMultipleUsersButton; + } } else { html += numberOfUsersShown(shownUsers ? shownUsers.length : 0); html += getEmailControls(json); @@ -354,6 +356,10 @@ function getTableEnd(json) { return html; } +function canListMultipleUsers() { + return !!cldrStatus.getPermissions()?.userIsManager; +} + function numberOfUsersShown(number) { return ( "
Number of users shown: " + number + "
\n" diff --git a/tools/cldr-apps/js/src/views/MainMenu.vue b/tools/cldr-apps/js/src/views/MainMenu.vue index 4eac410cec1..f7b31d5327a 100644 --- a/tools/cldr-apps/js/src/views/MainMenu.vue +++ b/tools/cldr-apps/js/src/views/MainMenu.vue @@ -35,7 +35,19 @@ -
  • My Organization ({{ org }})
  • +
  • + My Organization ({{ org }}) +
  • -
  • +