Documentation ¶
Index ¶
- Variables
- func Authorize(req *restful.Request, res *restful.Response, action string) bool
- func RegisterRules(e *Enforcer)
- type AndCheck
- type BaseCheck
- type DefaultRule
- type Enforcer
- func (e *Enforcer) Authorize(rule string, target map[string]string, cred map[string]interface{}) (bool, error)
- func (e *Enforcer) Enforce(rule string, target map[string]string, cred map[string]interface{}) (bool, error)
- func (e *Enforcer) LoadPolicyFile(path string, forcedReload bool, overWrite bool) error
- func (e *Enforcer) LoadRules(forcedReload bool) error
- func (e *Enforcer) RegisterDefaults(rules []DefaultRule)
- func (e *Enforcer) UpdateRules(rules map[string]BaseCheck)
- type FalseCheck
- type GenericCheck
- type NewCheckFunc
- type NotCheck
- type OrCheck
- type ParseState
- type ReduceFunc
- type RoleCheck
- type RuleCheck
- type Rules
- type TokenPair
- type TrueCheck
Constants ¶
This section is empty.
Variables ¶
View Source
var ReduceFuncMap = map[string]ReduceFunc{
"(,check,)": wrapCheck,
"(,and_expr,)": wrapCheck,
"(,or_expr,)": wrapCheck,
"check,and,check": makeAndExpr,
"or_expr,and,check": mixOrAndExpr,
"and_expr,and,check": extendAndExpr,
"check,or,check": makeOrExpr,
"and_expr,or,check": makeOrExpr,
"or_expr,or,check": extendOrExpr,
"not,check": makeNotExpr,
}
Functions ¶
func RegisterRules ¶
func RegisterRules(e *Enforcer)
Types ¶
type AndCheck ¶
type AndCheck struct {
// contains filtered or unexported fields
}
func NewAndCheck ¶
type BaseCheck ¶
type BaseCheck interface { String() string Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, currentRule string) bool }
func NewFalseCheck ¶
func NewFalseCheck() BaseCheck
func NewGenericCheck ¶
func NewRoleCheck ¶
func NewRuleCheck ¶
func NewTrueCheck ¶
func NewTrueCheck() BaseCheck
type DefaultRule ¶
type Enforcer ¶
type Enforcer struct { Rules map[string]BaseCheck DefaultRules []DefaultRule OverWrite bool }
func NewEnforcer ¶
func (*Enforcer) LoadPolicyFile ¶
func (*Enforcer) RegisterDefaults ¶
func (e *Enforcer) RegisterDefaults(rules []DefaultRule)
func (*Enforcer) UpdateRules ¶
type FalseCheck ¶
type FalseCheck struct{}
func (*FalseCheck) String ¶
func (this *FalseCheck) String() string
type GenericCheck ¶
type GenericCheck struct {
// contains filtered or unexported fields
}
func (*GenericCheck) String ¶
func (this *GenericCheck) String() string
type NewCheckFunc ¶
type NotCheck ¶
type NotCheck struct {
// contains filtered or unexported fields
}
func NewNotCheck ¶
type OrCheck ¶
type OrCheck struct {
// contains filtered or unexported fields
}
func NewOrCheck ¶
type ParseState ¶
type ParseState struct {
// contains filtered or unexported fields
}
func NewParseState ¶
func NewParseState() *ParseState
func (*ParseState) Result ¶
func (p *ParseState) Result() (interface{}, error)
func (*ParseState) Shift ¶
func (p *ParseState) Shift(tok string, val interface{})
type ReduceFunc ¶
type ReduceFunc func(args ...interface{}) []TokenPair
type RoleCheck ¶
type RoleCheck struct {
// contains filtered or unexported fields
}
type RuleCheck ¶
type RuleCheck struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.