diff --git a/app/helpers/admin/roles_helper.rb b/app/helpers/admin/roles_helper.rb index 7b4702e268..144a5b7e6f 100644 --- a/app/helpers/admin/roles_helper.rb +++ b/app/helpers/admin/roles_helper.rb @@ -11,6 +11,13 @@ module Admin ) end + def role_priveleges(role) + role + .permissions_as_keys + .map { |privilege| t("admin.roles.privileges.#{privilege}") } + .join(', ') + end + def disable_permissions?(permissions) permissions.filter { |privilege| role_flag_value(privilege).zero? } end diff --git a/app/views/admin/roles/_role.html.haml b/app/views/admin/roles/_role.html.haml index 636127354b..884e84b2e6 100644 --- a/app/views/admin/roles/_role.html.haml +++ b/app/views/admin/roles/_role.html.haml @@ -25,6 +25,6 @@ - else = link_to t('admin.roles.assigned_users', count: role.users.count), admin_accounts_path(role_ids: role.id) ยท - %abbr{ title: role.permissions_as_keys.map { |privilege| I18n.t("admin.roles.privileges.#{privilege}") }.join(', ') }= t('admin.roles.permissions_count', count: role.permissions_as_keys.size) + %abbr{ title: role_priveleges(role) }= t('admin.roles.permissions_count', count: role.permissions_as_keys.size) %div = table_link_to 'edit', t('admin.accounts.edit'), edit_admin_role_path(role) if can?(:update, role)