Skip to content

Commit

Permalink
Display parent tenant only when it is allowed by RBAC
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Nov 28, 2016
1 parent 578f896 commit c98a613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/views/ops/_rbac_tenant_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c98a613

Please sign in to comment.