MCPcopy
hub / github.com/apache/casbin / Enforce

Method Enforce

enforcer.go:927–929  ·  view source on GitHub ↗

Enforce decides whether a "subject" can access a "object" with the operation "action", input parameters are usually: (sub, obj, act).

(rvals ...interface{})

Source from the content-addressed store, hash-verified

925
926// Enforce decides whether a "subject" can access a "object" with the operation "action", input parameters are usually: (sub, obj, act).
927func (e *Enforcer) Enforce(rvals ...interface{}) (bool, error) {
928 return e.enforce("", nil, rvals...)
929}
930
931// EnforceWithMatcher use a custom matcher to decides whether a "subject" can access a "object" with the operation "action", input parameters are usually: (matcher, sub, obj, act), use model matcher by default when matcher is "".
932func (e *Enforcer) EnforceWithMatcher(matcher string, rvals ...interface{}) (bool, error) {

Callers 15

BenchmarkBasicModelFunction · 0.95
BenchmarkRBACModelFunction · 0.95
BenchmarkRBACModelSizesFunction · 0.95
BenchmarkRBACModelSmallFunction · 0.95
BenchmarkRBACModelMediumFunction · 0.95
BenchmarkRBACModelLargeFunction · 0.95
BenchmarkABACModelFunction · 0.95
BenchmarkABACRuleModelFunction · 0.95
BenchmarkKeyMatchModelFunction · 0.95

Calls 1

enforceMethod · 0.95

Tested by 15

BenchmarkBasicModelFunction · 0.76
BenchmarkRBACModelFunction · 0.76
BenchmarkRBACModelSizesFunction · 0.76
BenchmarkRBACModelSmallFunction · 0.76
BenchmarkRBACModelMediumFunction · 0.76
BenchmarkRBACModelLargeFunction · 0.76
BenchmarkABACModelFunction · 0.76
BenchmarkABACRuleModelFunction · 0.76
BenchmarkKeyMatchModelFunction · 0.76