removed unused methods

these methods were used in the old UIs

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-04-14 09:23:57 +02:00
parent a957474740
commit 150a338166
3 changed files with 0 additions and 279 deletions

View File

@@ -20,7 +20,6 @@ import (
"fmt"
"net"
"os"
"sort"
"strconv"
"strings"
@@ -435,19 +434,6 @@ func (a *Admin) validate() error {
return a.validateGroups()
}
// GetGroupsAsString returns the user's groups as a string
func (a *Admin) GetGroupsAsString() string {
if len(a.Groups) == 0 {
return ""
}
var groups []string
for _, g := range a.Groups {
groups = append(groups, g.Name)
}
sort.Strings(groups)
return strings.Join(groups, ",")
}
// CheckPassword verifies the admin password
func (a *Admin) CheckPassword(password string) (bool, error) {
if config.PasswordCaching {
@@ -579,19 +565,6 @@ func (a *Admin) HasPermission(perm string) bool {
return util.Contains(a.Permissions, perm)
}
// GetPermissionsAsString returns permission as string
func (a *Admin) GetPermissionsAsString() string {
return strings.Join(a.Permissions, ", ")
}
// GetLastLoginAsString returns the last login as string
func (a *Admin) GetLastLoginAsString() string {
if a.LastLogin > 0 {
return util.GetTimeFromMsecSinceEpoch(a.LastLogin).UTC().Format(iso8601UTCFormat)
}
return ""
}
// GetAllowedIPAsString returns the allowed IP as comma separated string
func (a *Admin) GetAllowedIPAsString() string {
return strings.Join(a.Filters.AllowList, ",")