You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/07/18 18:13:54 UTC
[17/25] incubator-trafficcontrol git commit: Tenant-utils - minor
func seperation
Tenant-utils - minor func seperation
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e0ae5528
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e0ae5528
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e0ae5528
Branch: refs/heads/master
Commit: e0ae55287958361b4e2a4b0393e328250c2f6ca4
Parents: abd4f7b
Author: nir-sopher <ni...@qwilt.com>
Authored: Mon Jun 26 17:55:01 2017 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Tue Jul 18 12:12:32 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/lib/UI/TenantUtils.pm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e0ae5528/traffic_ops/app/lib/UI/TenantUtils.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/TenantUtils.pm b/traffic_ops/app/lib/UI/TenantUtils.pm
index 8751d76..bdbe586 100644
--- a/traffic_ops/app/lib/UI/TenantUtils.pm
+++ b/traffic_ops/app/lib/UI/TenantUtils.pm
@@ -341,9 +341,18 @@ sub _error {
}
sub _is_resource_accessable {
+ my $self = shift;
+ my $tenants_data = shift;
+ my $resource_tenant = shift;
+ my $user_tenant = $self->current_user_tenant();
+ return $self->_is_resource_accessable_to_tenant($tenants_data, $resource_tenant, $user_tenant)
+}
+
+sub _is_resource_accessable_to_tenant {
my $self = shift;
my $tenants_data = shift;
my $resource_tenant = shift;
+ my $user_tenant = shift;
if ($self->{ignore_tenancy}) {
#mechanisem disabled
@@ -351,7 +360,6 @@ sub _is_resource_accessable {
}
- my $user_tenant = $self->current_user_tenant();
if ( defined($user_tenant) ) {
my $tenant_record = $tenants_data->{tenants_dict}->{$user_tenant};
my $is_active_tenant = $tenant_record->{row}->active;