Github user nir-sopher commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124637543
  
    --- Diff: traffic_ops/app/lib/API/Tenant.pm ---
    @@ -131,21 +130,74 @@ sub update {
     
        my $is_active = $params->{active};
        
    -   if ( !$params->{active} && $self->isRootTenant($id)) {
    -           return $self->alert("Root user cannot be in-active.");
    +   if ( !$params->{active} && $tenant_utils->is_root_tenant($tenants_data, 
$id)) {
    +           return $self->alert("Root tenant cannot be in-active.");
    +   }
    +
    +   #this is a write operation, allowed only by parents of the tenant 
(which are the owners of the resource of type tenant) 
    +   my $current_resource_tenancy = $self->db->resultset('Tenant')->search( 
{ id => $id } )->get_column('parent_id')->single();
    +   if (!defined($current_resource_tenancy)) {
    +           #no parent - the tenant is its-own owner
    --- End diff --
    
    Indeed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to