Github user nir-sopher commented on the issue: https://github.com/apache/incubator-trafficcontrol/pull/644 True. Note that there is also a matter of consistency: Tenant update can also be done only by the parent. Would you like to change that as well? On Jun 29, 2017 12:23 AM, "Jeremy Mitchell" <notificati...@github.com> wrote: > *@mitchell852* commented on this pull request. > ------------------------------ > > In traffic_ops/app/lib/API/Tenant.pm > <https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124660517> > : > > > @@ -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)) { > > oh, that's a good point. if i try to delete my own tenant, i will get back > "sorry, this tenant is assigned to a user", right? > > â > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124660517>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AXGkYJ98rZeJkzjhKMlVyTgHkyJFR3Prks5sIsRjgaJpZM4NwdcT> > . >
--- 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. ---