feat: add permission check

This commit is contained in:
Vyacheslav1557 2024-08-20 16:18:23 +05:00
parent 56135ff5df
commit bebc7f3076
14 changed files with 490 additions and 95 deletions

View file

@ -42,3 +42,7 @@ func (role Role) Valid() error {
}
return lib.ErrBadRole
}
func (role Role) AsPointer() *Role {
return &role
}

9
internal/models/user.go Normal file
View file

@ -0,0 +1,9 @@
package models
import "time"
type User struct {
UserId *int32 `json:"user_id" db:"user_id"`
Role *Role `json:"role" db:"role"`
UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
}