Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Move the check to the right place

Klaus Zanders22dce3a4c727
diff --git a/app/views/roles/_permissions.html.erb b/app/views/roles/_permissions.html.erb
index 11a1475868e..7c962ec21a6 100644
--- a/app/views/roles/_permissions.html.erb
+++ b/app/views/roles/_permissions.html.erb
@@ -27,7 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% permissions.each do |mod, mod_permissions| %>
- <% next if mod.blank? && !show_global_role %>
<% global_prefix = show_global_role ? 'fieldset--global--' : 'fieldset--' %>
<% module_name = mod.blank? ? 'fieldset--global--' + Project.model_name.human.downcase.gsub(' ', '_') : global_prefix + l_or_humanize(mod, prefix: 'project_module_').downcase.gsub(' ', '_') %>
<% module_id = module_name.parameterize %>
@@ -46,6 +45,7 @@ See COPYRIGHT and LICENSE files for more details.
</div>
<div class="-columns-2">
<% Array(mod_permissions).each do |permission| %>
+ <% next if permission.global? && !show_global_role %>
<div class="form--field">
<div class="form--field-container">
<label class="form--label-with-check-box">
@@ -61,7 +61,6 @@ See COPYRIGHT and LICENSE files for more details.
</div>
<% end %>
</div>
-
</fieldset>
<% end %>
<%= hidden_field_tag 'role[permissions][]', '' %>
diff --git a/spec/features/roles/update_spec.rb b/spec/features/global_roles/global_role_update_spec.rb
similarity index 100%
rename from spec/features/roles/update_spec.rb
rename to spec/features/global_roles/global_role_update_spec.rb