mitchell852 commented on a change in pull request #3758: Rewrote 
deliveryservice_stats to Go
URL: https://github.com/apache/trafficcontrol/pull/3758#discussion_r307916980
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/routing/routes.go
 ##########
 @@ -104,6 +105,9 @@ func Routes(d ServerData) ([]Route, []RawRoute, 
http.Handler, error) {
                {1.1, http.MethodPost, `asns/?$`, 
api.CreateHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil},
                {1.1, http.MethodDelete, `asns/{id}$`, 
api.DeleteHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil},
 
+               // Traffic Stats access
+               {1.2, http.MethodGet, `deliveryservice_stats`, 
trafficstats.GetDSStats, auth.PrivLevelOperations, Authenticated, nil},
 
 Review comment:
   @ocket8888 - this is the current check from DeliveryServiceStats.pm
   
   ```
                        if ( $self->is_delivery_service_name_assigned($ds_name) 
|| &is_admin($self) || &is_oper($self) ) {
   ```
   if it's assigned to you (we don't do that anymore) or you're admin or ops. 
(not sure why it doesn't just check ops...but anyhow)
   
   so this is broken and i think you should fix it. the real check should be:
   1. do you pass the tenancy check?
   2. are you readonly or above?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to