This commit is contained in:
Nicola Murino
2021-02-11 19:45:52 +01:00
parent 4ddfe41f23
commit 51f110bc7b
31 changed files with 428 additions and 77 deletions

View File

@@ -718,22 +718,16 @@ func (u *User) GetQuotaSummary() string {
func (u *User) GetPermissionsAsString() string {
result := ""
for dir, perms := range u.Permissions {
var dirPerms string
for _, p := range perms {
if len(dirPerms) > 0 {
dirPerms += ", "
}
dirPerms += p
}
dirPerms := strings.Join(perms, ", ")
dp := fmt.Sprintf("%#v: %#v", dir, dirPerms)
if dir == "/" {
if len(result) > 0 {
if result != "" {
result = dp + ", " + result
} else {
result = dp
}
} else {
if len(result) > 0 {
if result != "" {
result += ", "
}
result += dp