upd(internal): remove unused operations and scope

This commit is contained in:
Tit Petric
2019-03-14 23:45:48 +01:00
parent 1dab0e4830
commit a8c5cc227d
2 changed files with 0 additions and 61 deletions
-24
View File
@@ -1,24 +0,0 @@
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"`
}
)
-37
View File
@@ -1,37 +0,0 @@
package rules
type (
scope struct {
providers []ScopeItem
}
ScopeItem struct {
Scope string `json:"scope"`
Permissions []OperationGroup `json:"permissions"`
}
ScopeProvider interface {
Resource() Resource
Permissions() []OperationGroup
}
ScopeInterface interface {
Add(ScopeProvider)
List() []ScopeItem
}
)
func NewScope() ScopeInterface {
return &scope{}
}
func (s *scope) Add(p ScopeProvider) {
s.providers = append(s.providers, ScopeItem{
Scope: p.Resource().Scope,
Permissions: p.Permissions(),
})
}
func (s *scope) List() []ScopeItem {
return s.providers
}