Reorganization of backend + new routes
This commit is contained in:
14
backend/core/models/roles.go
Normal file
14
backend/core/models/roles.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type Role struct {
|
||||
bun.BaseModel `bun:"table:roles"`
|
||||
ID uuid.UUID `bun:"id,pk,type:uuid,default:gen_random_uuid()" json:"id"`
|
||||
Name string `bun:"name,unique,notnull" json:"name"`
|
||||
|
||||
Permissions []Permission `bun:"m2m:permissions_to_users,join:Role=Permission" json:"permissions,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user