🐛 Fix compare perm node panic

This commit is contained in:
LittleSheep 2024-08-25 18:08:37 +08:00
parent a6b0170b1d
commit 0f2b45352c
2 changed files with 9 additions and 5 deletions

View File

@ -4,9 +4,9 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Pagination bots api">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":bug: Fix query issue">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/server/api/bots_api.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/services/perms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/perms.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -153,7 +153,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value=":sparkles: View auth factors in admin panel" />
<MESSAGE value=":rotating_light: Fix ts lint issue" />
<MESSAGE value=":poop: Remove mis-imported cgo" />
<MESSAGE value=":bug: Bug fixes" />
@ -178,7 +177,8 @@
<MESSAGE value=":sparkles: Bots aka. automated accounts" />
<MESSAGE value=":sparkles: Return affiliated to and automated by in userinfo grpc call" />
<MESSAGE value=":sparkles: Pagination bots api" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Pagination bots api" />
<MESSAGE value=":bug: Fix query issue" />
<option name="LAST_COMMIT_MESSAGE" value=":bug: Fix query issue" />
</component>
<component name="VgoProject">
<settings-migrated>true</settings-migrated>

View File

@ -26,7 +26,11 @@ func ComparePermNode(held any, required any) bool {
requiredValue := reflect.ValueOf(required)
switch heldValue.Kind() {
case reflect.Int, reflect.Float64:
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
if heldValue.Int() >= requiredValue.Int() {
return true
}
case reflect.Float32, reflect.Float64:
if heldValue.Float() >= requiredValue.Float() {
return true
}