scinote-web/app/helpers/user_roles_helper.rb
aignatov-bio 992d3bffa3
small permissions interface updates [SCI-6145] (#3620)
Co-authored-by: Anton <anton@scinote.net>
2021-10-28 13:58:31 +02:00

9 lines
241 B
Ruby

# frozen_string_literal: true
module UserRolesHelper
def user_roles_collection
Rails.cache.fetch([current_user, 'available_user_roles']) do
@user_roles_collection ||= UserRole.order(id: :asc).pluck(:name, :id)
end
end
end