Skip to content

Commit

Permalink
Only display the Global section when requesting to show global roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Zanders committed Jul 19, 2023
1 parent 86f4a55 commit 25c3ce5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/roles/set_attributes_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
module Roles
class SetAttributesService < ::BaseServices::SetAttributes
def set_default_attributes(*)
model.permissions = Role.non_member.permissions if model.permissions.nil? || model.permissions.empty?
model.permissions = Role.non_member.permissions if model.permissions.blank?
end
end
end
2 changes: 1 addition & 1 deletion app/views/roles/_permissions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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 %>
Expand Down

0 comments on commit 25c3ce5

Please sign in to comment.