Versions in this module Expand all Collapse all v0 v0.3.2 Nov 9, 2018 Changes in this version + var ReduceFuncMap = map[string]ReduceFunc + func Authorize(req *restful.Request, res *restful.Response, action string) bool + func RegisterRules(e *Enforcer) + type AndCheck struct + func NewAndCheck(check1 BaseCheck, check2 BaseCheck) *AndCheck + func (this *AndCheck) AddCheck(rule BaseCheck) *AndCheck + func (this *AndCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *AndCheck) String() string + type BaseCheck interface + Exec func(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + String func() string + func NewFalseCheck() BaseCheck + func NewGenericCheck(kind string, match string) BaseCheck + func NewRoleCheck(kind string, match string) BaseCheck + func NewRuleCheck(kind string, match string) BaseCheck + func NewTrueCheck() BaseCheck + type DefaultRule struct + CheckStr string + Name string + type Enforcer struct + DefaultRules []DefaultRule + OverWrite bool + Rules map[string]BaseCheck + func NewEnforcer(overWrite bool) *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 struct + func (this *FalseCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *FalseCheck) String() string + type GenericCheck struct + func (this *GenericCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *GenericCheck) String() string + type NewCheckFunc func(kind string, match string) BaseCheck + type NotCheck struct + func NewNotCheck(check BaseCheck) *NotCheck + func (this *NotCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *NotCheck) String() string + type OrCheck struct + func NewOrCheck(check1 BaseCheck, check2 BaseCheck) *OrCheck + func (this *OrCheck) AddCheck(rule BaseCheck) *OrCheck + func (this *OrCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *OrCheck) PopCheck() (*OrCheck, BaseCheck) + func (this *OrCheck) String() string + type ParseState struct + func NewParseState() *ParseState + func (p *ParseState) Result() (interface{}, error) + func (p *ParseState) Shift(tok string, val interface{}) + type ReduceFunc func(args ...interface{}) []TokenPair + type RoleCheck struct + func (this *RoleCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *RoleCheck) String() string + type RuleCheck struct + func (this *RuleCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *RuleCheck) String() string + type Rules struct + Rules map[string]BaseCheck + func NewRules(data []byte, defaultRule []DefaultRule) (*Rules, error) + func (r *Rules) Load(data []byte, defaultRules []DefaultRule) error + func (r *Rules) String() string + type TokenPair struct + type TrueCheck struct + func (this *TrueCheck) Exec(target map[string]string, cred map[string]interface{}, enforcer Enforcer, ...) bool + func (this *TrueCheck) String() string