moved field validation to validation package

This commit is contained in:
Alex
2025-03-11 20:42:45 +01:00
parent 0d6013d566
commit c6ea179eca
2 changed files with 2 additions and 7 deletions

View File

@@ -1,15 +1,10 @@
package utils
package validation
import (
"GoMembership/internal/models"
"errors"
"reflect"
)
func HasPrivilige(user *models.User, privilige int8) bool {
return user.RoleID >= privilige
}
// FilterAllowedStructFields filters allowed fields recursively in a struct and modifies structToModify in place.
func FilterAllowedStructFields(input interface{}, existing interface{}, allowedFields map[string]bool, prefix string) error {
v := reflect.ValueOf(input)

View File

@@ -1,4 +1,4 @@
package utils
package validation
import (
"reflect"