GetPolicy gets all rules in a policy.
(sec string, ptype string)
| 109 | |
| 110 | // GetPolicy gets all rules in a policy. |
| 111 | func (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. |
| 120 | func (model Model) GetFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) ([][]string, error) { |
nothing calls this directly
no test coverage detected