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:
@@ -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
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user