-
Notifications
You must be signed in to change notification settings - Fork 13
/
role.go
39 lines (31 loc) · 913 Bytes
/
role.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package acl
import "github.com/coretrix/hitrix/service/component/crud"
type RolesResponseDTO struct {
Rows []*RoleResponseDTO
Total int
Columns []crud.Column
PageContext *ResourcesResponseDTO
}
type RoleResponseDTO struct {
ID uint64
Name string
Resources []*ResourceResponseDTO `json:",omitempty"`
}
type RoleRequestDTO struct {
ID uint64 `binding:"required"`
}
type CreateOrUpdateRoleRequestDTO struct {
Name string `binding:"required"`
Resources []*RoleResourceRequestDTO `binding:"required,min=1,dive"`
}
type RoleResourceRequestDTO struct {
ResourceID uint64 `binding:"required"`
PermissionIDs []uint64 `binding:"required,min=1"`
}
type RolePermissionRequestDTO struct {
PermissionID uint64 `binding:"required"`
}
type AssignRoleToUserRequestDTO struct {
UserID uint64 `binding:"required"`
RoleID uint64 `binding:"required"`
}