GetValuesForFieldInPolicyAllTypes gets all values for a field for all rules in a policy of all ptypes, duplicated values are removed.
(sec string, fieldIndex int)
| 421 | |
| 422 | // GetValuesForFieldInPolicyAllTypes gets all values for a field for all rules in a policy of all ptypes, duplicated values are removed. |
| 423 | func (model Model) GetValuesForFieldInPolicyAllTypes(sec string, fieldIndex int) ([]string, error) { |
| 424 | values := []string{} |
| 425 | |
| 426 | for ptype := range model[sec] { |
| 427 | v, err := model.GetValuesForFieldInPolicy(sec, ptype, fieldIndex) |
| 428 | if err != nil { |
| 429 | return nil, err |
| 430 | } |
| 431 | values = append(values, v...) |
| 432 | } |
| 433 | |
| 434 | util.ArrayRemoveDuplicates(&values) |
| 435 | |
| 436 | return values, nil |
| 437 | } |
| 438 | |
| 439 | // GetValuesForFieldInPolicyAllTypesByName gets all values for a field for all rules in a policy of all ptypes, duplicated values are removed. |
| 440 | func (model Model) GetValuesForFieldInPolicyAllTypesByName(sec string, field string) ([]string, error) { |
no test coverage detected