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

Method GetAssertion

model/model.go:214–222  ·  view source on GitHub ↗
(sec string, ptype string)

Source from the content-addressed store, hash-verified

212}
213
214func (model Model) GetAssertion(sec string, ptype string) (*Assertion, error) {
215 if model[sec] == nil {
216 return nil, fmt.Errorf("missing required section %s", sec)
217 }
218 if model[sec][ptype] == nil {
219 return nil, fmt.Errorf("missing required definition %s in section %s", ptype, sec)
220 }
221 return model[sec][ptype], nil
222}
223
224// PrintModel prints the model to the log.
225func (model Model) PrintModel() {

Callers 15

GetPolicyMethod · 0.95
GetFilteredPolicyMethod · 0.95
HasPolicyExMethod · 0.95
HasPolicyMethod · 0.95
AddPolicyMethod · 0.95
RemovePolicyMethod · 0.95
UpdatePolicyMethod · 0.95
UpdatePoliciesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected