1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 15:06:23 -07:00

Don't add the staff categories for actions the current staff member can't access

This commit is contained in:
Eggbertx 2022-07-25 13:35:56 -07:00
parent 7fbdc12b2c
commit 24cf95f400
3 changed files with 6 additions and 4 deletions

View file

@ -159,13 +159,15 @@ export function createStaffMenu(rank = staffInfo.Rank) {
} }
if(rank < 2) return $staffMenu; if(rank < 2) return $staffMenu;
$staffMenu.append(menuItem("Moderation", true)); if(modActions.length > 0)
$staffMenu.append(menuItem("Moderation", true));
for(const action of modActions) { for(const action of modActions) {
$staffMenu.append(menuItem(action)); $staffMenu.append(menuItem(action));
} }
if(rank < 3) return $staffMenu; if(rank < 3) return $staffMenu;
$staffMenu.append(menuItem("Administration", true)); if(adminActions.length > 0)
$staffMenu.append(menuItem("Administration", true));
for(const action of adminActions) { for(const action of adminActions) {
$staffMenu.append(menuItem(action)); $staffMenu.append(menuItem(action));
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long