3
0
Files
corteza/internal/rules/operations.go
Tit Petric 876a304def upd(all):
- moved Access type from system to internal/rules,
- moved Resource from system to internal/rules,
- update imports for new type locations,
- add scope list container to inject permissions,
- update permissions API call to return default perms,
- update codegen for generated Rules types
2019-02-06 11:19:32 +01:00

36 lines
859 B
Go

package rules
type (
OperationGroup struct {
Title string `json:"title"`
Operations []Operation `json:"operations"`
}
Operation struct {
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
// Enabled will show/hide the operation in administration
Enabled bool `json:"enabled"`
// The default value for managing operations on a role
//
// nil = unset (inherit),
// true = checked (allow),
// false = unchecked (deny)
Default Access `json:"default"`
}
Permission struct {
// Scope (organisation, team, channel)
Scope string `json:"scope"`
// Resource (org:1, team:123123, etc.)
Resource string `json:"resource"`
// Operation name (Operation.Key)
Operation string `json:"operation"`
// Operation state (inherit, allow, deny)
State Access `json:"state"`
}
)