Skip to content

Commit

Permalink
Fixed /api/2.0/roles always returning empty array (#4397)
Browse files Browse the repository at this point in the history
* Fixed /api/2.0/roles always returning empty array

* Fixed API versions > 1 not returning capabilities
  • Loading branch information
ocket8888 committed Feb 13, 2020
1 parent 8e709a8 commit 232d667
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion traffic_ops/traffic_ops_golang/role/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,12 @@ func (role *TORole) Read() ([]interface{}, error, error, int) {
if userErr != nil || sysErr != nil {
return nil, userErr, sysErr, errCode
}

returnable := []interface{}{}
for _, val := range vals {
rl := val.(*TORole)
switch {
case version.Minor >= 3:
case version.Major > 1 || version.Minor >= 3:
caps := ([]string)(*rl.PQCapabilities)
rl.Capabilities = &caps
returnable = append(returnable, rl)
Expand Down

0 comments on commit 232d667

Please sign in to comment.