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

Method GetPolicy

model/policy.go:111–117  ·  view source on GitHub ↗

GetPolicy gets all rules in a policy.

(sec string, ptype string)

Source from the content-addressed store, hash-verified

109
110// GetPolicy gets all rules in a policy.
111func (model Model) GetPolicy(sec string, ptype string) ([][]string, error) {
112 _, err := model.GetAssertion(sec, ptype)
113 if err != nil {
114 return nil, err
115 }
116 return model[sec][ptype].Policy, nil
117}
118
119// GetFilteredPolicy gets rules based on field filters from a policy.
120func (model Model) GetFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) ([][]string, error) {

Callers

nothing calls this directly

Calls 1

GetAssertionMethod · 0.95

Tested by

no test coverage detected