diff --git a/app/models/tenant.rb b/app/models/tenant.rb index b3219ca3876..7a551b65e8d 100644 --- a/app/models/tenant.rb +++ b/app/models/tenant.rb @@ -320,6 +320,10 @@ def build_tenant_tree data_tenant end + def allowed? + Rbac::Filterer.filtered_object(self).present? + end + private # when a root tenant has an attribute with a nil value, diff --git a/app/views/ops/_rbac_tenant_details.html.haml b/app/views/ops/_rbac_tenant_details.html.haml index bc9020a299d..05d129b075e 100644 --- a/app/views/ops/_rbac_tenant_details.html.haml +++ b/app/views/ops/_rbac_tenant_details.html.haml @@ -15,7 +15,7 @@ .col-md-8 = h(@tenant.description) - parent = @tenant.parent - - if parent + - if parent && parent.allowed? .form-group %label.control-label.col-md-2 = _("Parent")