Documentation
¶
Index ¶
- type Assertion
- type AssertionMap
- type Function
- type FunctionMap
- type Model
- func (model Model) AddPolicy(sec string, ptype string, policy []string) bool
- func (model Model) BuildRoleLinks()
- func (model Model) ClearPolicy()
- func (model Model) GetFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValue string) [][]string
- func (model Model) GetPolicy(sec string, ptype string) [][]string
- func (model Model) GetValuesForFieldInPolicy(sec string, ptype string, fieldIndex int) []string
- func (model Model) HasPolicy(sec string, ptype string, policy []string) bool
- func (model Model) PrintModel()
- func (model Model) PrintPolicy()
- func (model Model) RemovePolicy(sec string, ptype string, policy []string) bool
- type Role
- type RoleManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assertion ¶
type Assertion struct {
Key string
Value string
Tokens []string
Policy [][]string
RM *RoleManager
}
type AssertionMap ¶
AssertionMap is the collection of assertions, can be "r", "p", "g", "e", "m".
type Function ¶
type Function func(args ...interface{}) (interface{}, error)
Function represents a function that is used in the matchers, used to get attributes in ABAC.
type FunctionMap ¶
FunctionMap represents the collection of Function.
func (FunctionMap) AddFunction ¶
func (fm FunctionMap) AddFunction(name string, function Function)
Add an expression function.
type Model ¶
type Model map[string]AssertionMap
Model represents the whole access control model.
func (Model) GetFilteredPolicy ¶
func (model Model) GetFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValue string) [][]string
Get rules based on a field filter from a policy.
func (Model) GetValuesForFieldInPolicy ¶
Get all values for a field for all rules in a policy, duplicated values are removed.
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
Role is the data structure for a role in RBAC.
type RoleManager ¶
type RoleManager struct {
// contains filtered or unexported fields
}
RoleManager is the interface to manage the roles in RBAC.
func (*RoleManager) GetRoles ¶
func (rm *RoleManager) GetRoles(name string) []string
Get the roles that a subject has (aka inherits).
Click to show internal directories.
Click to hide internal directories.
