moved field validation to validation package
This commit is contained in:
@@ -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)
|
||||
@@ -1,4 +1,4 @@
|
||||
package utils
|
||||
package validation
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
Reference in New Issue
Block a user