From 9b61dde7c8907db64127ee48d92bd8b78330cd03 Mon Sep 17 00:00:00 2001 From: Eggbertx Date: Tue, 6 Jun 2023 13:44:42 -0700 Subject: [PATCH] Make actino registration functions for individual staff roles private --- pkg/manage/actionsAdminPerm.go | 2 +- pkg/manage/actionsJanitorPerm.go | 2 +- pkg/manage/actionsModPerm.go | 2 +- pkg/manage/actionsNoPerm.go | 2 +- pkg/manage/util.go | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/manage/actionsAdminPerm.go b/pkg/manage/actionsAdminPerm.go index 93895bd1..edbe4b5c 100644 --- a/pkg/manage/actionsAdminPerm.go +++ b/pkg/manage/actionsAdminPerm.go @@ -21,7 +21,7 @@ import ( // manage actions that require admin-level permission go here -func RegisterAdminPages() { +func registerAdminPages() { actions = append(actions, Action{ ID: "cleanup", diff --git a/pkg/manage/actionsJanitorPerm.go b/pkg/manage/actionsJanitorPerm.go index aed34ea3..d49f7fa4 100644 --- a/pkg/manage/actionsJanitorPerm.go +++ b/pkg/manage/actionsJanitorPerm.go @@ -18,7 +18,7 @@ import ( // manage actions that require at least janitor-level permission go here -func RegisterJanitorPages() { +func registerJanitorPages() { actions = append(actions, Action{ ID: "logout", diff --git a/pkg/manage/actionsModPerm.go b/pkg/manage/actionsModPerm.go index 0637f5ce..2a04275b 100644 --- a/pkg/manage/actionsModPerm.go +++ b/pkg/manage/actionsModPerm.go @@ -21,7 +21,7 @@ import ( // manage actions that require moderator-level permission go here -func RegisterModeratorPages() { +func registerModeratorPages() { actions = append(actions, Action{ ID: "bans", diff --git a/pkg/manage/actionsNoPerm.go b/pkg/manage/actionsNoPerm.go index e18549d4..9a76fb3d 100644 --- a/pkg/manage/actionsNoPerm.go +++ b/pkg/manage/actionsNoPerm.go @@ -60,7 +60,7 @@ var ( } ) -func RegisterNoPermPages() { +func registerNoPermPages() { actions = append(actions, *loginAction, Action{ ID: "staffinfo", diff --git a/pkg/manage/util.go b/pkg/manage/util.go index 8d4ef711..7873e1c2 100644 --- a/pkg/manage/util.go +++ b/pkg/manage/util.go @@ -118,10 +118,10 @@ func GetStaffRank(request *http.Request) int { func init() { RegisterManagePage("actions", "Staff actions", JanitorPerms, AlwaysJSON, getStaffActions) RegisterManagePage("dashboard", "Dashboard", JanitorPerms, NoJSON, dashboardCallback) - RegisterNoPermPages() - RegisterJanitorPages() - RegisterModeratorPages() - RegisterAdminPages() + registerNoPermPages() + registerJanitorPages() + registerModeratorPages() + registerAdminPages() } func dashboardCallback(_ http.ResponseWriter, _ *http.Request, staff *gcsql.Staff, _ bool, _ *zerolog.Event, errEv *zerolog.Event) (interface{}, error) {