Github user mitchell852 commented on a diff in the pull request: https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124625956 --- Diff: traffic_ops/app/lib/API/Tenant.pm --- @@ -248,7 +326,17 @@ sub delete { if ( !defined($tenant) ) { return $self->not_found(); } - my $name = $self->db->resultset('Tenant')->search( { id => $id } )->get_column('name')->single(); + + my $parent_tenant = $tenant->parent_id; + + my $tenant_utils = UI::TenantUtils->new($self); + my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef); + + if (!$tenant_utils->is_tenant_resource_accessible($tenants_data, $parent_tenant)) { --- End diff -- i don't think that deleting a tenant should matter what the parent tenant is. for example, if this is the tenant hierarcy: - root -- tenant 1 --- tenant 1a --- tenant 1b and i have a user with tenant = tenant 1a, then i should be able to delete tenant 1a even though i don't have tenant 1 assigned to me. what do you think?
--- 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. ---