Module: Pageflow::Admin::UsersHelper
- Includes:
- QuotaHelper
- Defined in:
- app/helpers/pageflow/admin/users_helper.rb
Overview
rubocop:todo Style/Documentation
Instance Method Summary collapse
- #collection_for_user_roles ⇒ Object
- #delete_own_user_section ⇒ Object
- #users_quota_state(account) ⇒ Object
Methods included from QuotaHelper
Instance Method Details
#collection_for_user_roles ⇒ Object
19 20 21 22 23 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 19 def collection_for_user_roles User.roles_accessible_by(current_ability).index_by do |role| t(role, scope: 'pageflow.admin.users.roles') end end |
#delete_own_user_section ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 25 def delete_own_user_section = Pageflow.config..call(current_user) if == true render('pageflow/admin/users/may_delete') else render('pageflow/admin/users/cannot_delete', reason: ) end end |
#users_quota_state(account) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/pageflow/admin/users_helper.rb', line 6 def users_quota_state(account) quota = Pageflow.config.quotas.get(:users, account) data_attributes = { account_id: account.id, state: quota.state } render('pageflow/admin/users/quota_state', account:, quota:, data_attributes:) end |