36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
package handlers
|
|
|
|
const (
|
|
PermissionCreate = iota
|
|
PermissionRead
|
|
PermissionReadAll
|
|
PermissionUpdate
|
|
PermissionDelete
|
|
)
|
|
|
|
var (
|
|
RolePermissions map[string]map[string][]int = map[string]map[string][]int{
|
|
|
|
"administrator": map[string][]int{
|
|
"Contest": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"Participant": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"School": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"Question": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"Answer": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"Response": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
},
|
|
|
|
"school": map[string][]int{
|
|
"Participant": []int{PermissionCreate, PermissionRead, PermissionReadAll, PermissionUpdate, PermissionDelete},
|
|
"School": []int{PermissionRead, PermissionUpdate},
|
|
},
|
|
|
|
"participant": map[string][]int{
|
|
"Response": []int{PermissionUpdate},
|
|
},
|
|
|
|
"subscriber": map[string][]int{
|
|
"School": []int{PermissionCreate, PermissionRead},
|
|
},
|
|
}
|
|
)
|