mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
chore: quick clean up
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
type Role int
|
||||
|
||||
const (
|
||||
NONE Role = 0
|
||||
None Role = 0
|
||||
Shell Role = 1 << iota
|
||||
Actions
|
||||
Download
|
||||
)
|
||||
|
||||
const AllRole = Shell | Actions | Download
|
||||
const All = Shell | Actions | Download
|
||||
|
||||
func ParseRole(commaValues string) Role {
|
||||
if commaValues == "" {
|
||||
return AllRole
|
||||
return All
|
||||
}
|
||||
|
||||
var roles Role
|
||||
@@ -31,7 +31,7 @@ func ParseRole(commaValues string) Role {
|
||||
case "download":
|
||||
roles |= Download
|
||||
case "none":
|
||||
return NONE
|
||||
return None
|
||||
}
|
||||
}
|
||||
return roles
|
||||
|
||||
@@ -201,7 +201,7 @@ func UserFromContext(ctx context.Context) *User {
|
||||
email := claims["email"].(string)
|
||||
name := claims["name"].(string)
|
||||
containerFilter := container.ContainerLabels{}
|
||||
roles := AllRole
|
||||
roles := All
|
||||
if filter, ok := claims["filter"].(string); ok {
|
||||
containerFilter, err = container.ParseContainerFilter(filter)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user