Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrRuleLoadError = fmt.Errorf("rule load failure") ErrNoRulesDefined = fmt.Errorf("command has no rules") )
Functions ¶
func EvaluateCommandEntry ¶
func EvaluateCommandEntry(perms []string, ce data.CommandEntry, env rules.EvaluationEnvironment) (bool, error)
EvaluateCommandEntry is equivalent to EvaluateRules, except that it accepts a data.Command entry from which it builds its complete rules set, upon which it calls EvaluateRules. It returns true if the provided permissions meet the requirements derived by the CommandEntry and EvaluationEnvironment. It returns an error if there isn't at least one rule in the Rule slice.
func EvaluateRules ¶
EvaluateRules returns true if the provided permissions meet the requirements defined by the given rules and EvaluationEnvironment. It returns an error if there isn't at least one rule in the Rule slice.
func ParseCommandEntry ¶
func ParseCommandEntry(ce data.CommandEntry) ([]rules.Rule, error)
ParseCommandEntry is a helper function that accepts a fully-constructed data.CommandEntry, tokenizes and parses all of the command's rule strings, and returns a []Rules value.
Types ¶
This section is empty.