mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
fix: allow user if users label is empty
This commit is contained in:
@@ -295,12 +295,11 @@ func (auth *Auth) ResourceAllowed(c *gin.Context, context types.UserContext) (bo
|
|||||||
// Check if user is allowed
|
// Check if user is allowed
|
||||||
if len(labels.Users) != 0 {
|
if len(labels.Users) != 0 {
|
||||||
log.Debug().Msg("Checking users")
|
log.Debug().Msg("Checking users")
|
||||||
if len(labels.Users) == 0 {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
if slices.Contains(labels.Users, context.Username) {
|
if slices.Contains(labels.Users, context.Username) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not allowed
|
// Not allowed
|
||||||
|
|||||||
Reference in New Issue
Block a user