diff --git a/pkg/nex/sec/perms.go b/pkg/nex/sec/perms.go index 0cbdb7f..14ec172 100644 --- a/pkg/nex/sec/perms.go +++ b/pkg/nex/sec/perms.go @@ -3,6 +3,7 @@ package sec import ( "fmt" "reflect" + "strconv" ) func (v UserInfo) HasPermNode(requiredKey string, requiredValue any) bool { @@ -41,6 +42,11 @@ func comparePermNode(held any, required any) bool { heldValue := reflect.ValueOf(held) requiredValue := reflect.ValueOf(required) + if isNumeric(requiredValue) && heldValue.Kind() == reflect.String { + numericValue, _ := strconv.ParseFloat(heldValue.String(), 64) + return toFloat64(requiredValue) >= numericValue + } + switch heldValue.Kind() { case reflect.String: if heldValue.String() == requiredValue.String() {