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:07:47 UTC

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

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



##########
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:
       just for consistency in the project, would you mind changing these to `userErr` and `sysErr`? and in a couple places down below as well? sorry for such a nitpicky comment




----------------------------------------------------------------
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