feat: add permission check
This commit is contained in:
parent
56135ff5df
commit
bebc7f3076
14 changed files with 490 additions and 95 deletions
|
@ -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
9
internal/models/user.go
Normal 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"`
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue