From dc9c3751f5ee379a67c1f72aa51ce279f0479833 Mon Sep 17 00:00:00 2001 From: Rima Shah <22248619+rimashah25@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:59:41 -0700 Subject: [PATCH] Reverting partial change from PR 7891. (#7929) --- CHANGELOG.md | 2 +- .../traffic_ops_golang/routing/middleware/wrappers.go | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62895a318a..1722cd0858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,7 +101,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7814](https://github.com/apache/trafficcontrol/issues/7814) All Go components: Updated the module path to [`github.com/apache/trafficcontrol/v8`](https://pkg.go.dev/github.com/apache/trafficcontrol/v8). Module https://pkg.go.dev/github.com/apache/trafficcontrol will not receive further updates. ### Fixed -- [#7891](https://github.com/apache/trafficcontrol/pull/7891) *Traffic Ops*: Created clause to distinguish api versions < 5 when handling 403 in middleware wrappers and updated job routes for v4 and v5 +- [#7891](https://github.com/apache/trafficcontrol/pull/7891) *Traffic Ops*: Updated job routes for v4 and v5. - [#7890](https://github.com/apache/trafficcontrol/pull/7890) *Traffic Ops*: Fixed missing changelog entries to v5 routes. - [#7887](https://github.com/apache/trafficcontrol/pull/7887) *Traffic Ops*: Limit Delivery Services returned for GET /servers/{id}/deliveryservices to ones in the same CDN - [#7885](https://github.com/apache/trafficcontrol/pull/7885) *Traffic Portal*: Fixed the issue where Compare Profiles page was not being displayed. diff --git a/traffic_ops/traffic_ops_golang/routing/middleware/wrappers.go b/traffic_ops/traffic_ops_golang/routing/middleware/wrappers.go index 6f1fc71c1c..4785916036 100644 --- a/traffic_ops/traffic_ops_golang/routing/middleware/wrappers.go +++ b/traffic_ops/traffic_ops_golang/routing/middleware/wrappers.go @@ -120,11 +120,9 @@ func (a AuthBase) GetWrapper(privLevelRequired int) Middleware { return } } else { - if v.Major < 5 { - if !cfg.RoleBasedPermissions && user.PrivLevel < privLevelRequired { - api.HandleErr(w, r, nil, http.StatusForbidden, errors.New("Forbidden."), nil) - return - } + if !cfg.RoleBasedPermissions && user.PrivLevel < privLevelRequired { + api.HandleErr(w, r, nil, http.StatusForbidden, errors.New("Forbidden."), nil) + return } } api.AddUserToReq(r, user)