upd(internal): remove unused operations and scope
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
)
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user