You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/01/28 23:26:34 UTC

[GitHub] [trafficcontrol] TaylorCFrey commented on a change in pull request #5474: Bugfix/5405 parent child tenant update

TaylorCFrey commented on a change in pull request #5474:
URL: https://github.com/apache/trafficcontrol/pull/5474#discussion_r566476603



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -207,11 +208,50 @@ func (ten *TOTenant) IsTenantAuthorized(user *auth.CurrentUser) (bool, error) {
 	return tenant.IsResourceAuthorizedToUserTx(*ten.ParentID, user, ten.APIInfo().Tx.Tx)
 }
 
-func (tn *TOTenant) Update(h http.Header) (error, error, int) {
-	if tn.Name != nil && *tn.Name == rootName {
+// Update wraps tenant validation and the generic API Update call into a single call.
+func (ten *TOTenant) Update(h http.Header) (error, error, int) {
+
+	usererr, syserr, statusCode := ten.isUpdatable()
+	if usererr != nil || syserr != nil {
+		return usererr, syserr, statusCode

Review comment:
       Hey! Great catch. I had it in my head to dbl chk before submitting, but apparently missed it. Thanks for getting that.




----------------------------------------------------------------
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:
users@infra.apache.org