1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 21:33:18 +01:00

chore: quick clean up

This commit is contained in:
Amir Raminfar
2025-09-21 14:57:06 -07:00
parent 5f24657b41
commit e75b4d03bc
2 changed files with 5 additions and 5 deletions

View File

@@ -7,17 +7,17 @@ import (
type Role int type Role int
const ( const (
NONE Role = 0 None Role = 0
Shell Role = 1 << iota Shell Role = 1 << iota
Actions Actions
Download Download
) )
const AllRole = Shell | Actions | Download const All = Shell | Actions | Download
func ParseRole(commaValues string) Role { func ParseRole(commaValues string) Role {
if commaValues == "" { if commaValues == "" {
return AllRole return All
} }
var roles Role var roles Role
@@ -31,7 +31,7 @@ func ParseRole(commaValues string) Role {
case "download": case "download":
roles |= Download roles |= Download
case "none": case "none":
return NONE return None
} }
} }
return roles return roles

View File

@@ -201,7 +201,7 @@ func UserFromContext(ctx context.Context) *User {
email := claims["email"].(string) email := claims["email"].(string)
name := claims["name"].(string) name := claims["name"].(string)
containerFilter := container.ContainerLabels{} containerFilter := container.ContainerLabels{}
roles := AllRole roles := All
if filter, ok := claims["filter"].(string); ok { if filter, ok := claims["filter"].(string); ok {
containerFilter, err = container.ParseContainerFilter(filter) containerFilter, err = container.ParseContainerFilter(filter)
if err != nil { if err != nil {