Module: Pageflow::Admin::UsersHelper

Includes:
QuotaHelper
Defined in:
app/helpers/pageflow/admin/users_helper.rb

Instance Method Summary collapse

Methods included from QuotaHelper

#quota_state_description

Instance Method Details

#collection_for_user_rolesObject



19
20
21
# File 'app/helpers/pageflow/admin/users_helper.rb', line 19

def collection_for_user_roles
  User.roles_accessible_by(current_ability).index_by { |role| t(role, :scope => 'pageflow.admin.users.roles') }
end

#delete_own_user_sectionObject



23
24
25
26
27
28
29
30
# File 'app/helpers/pageflow/admin/users_helper.rb', line 23

def delete_own_user_section
  user_deletion_permission = Pageflow.config.authorize_user_deletion.call(current_user)
  if user_deletion_permission == true
    render('pageflow/admin/users/may_delete')
  else
    render('pageflow/admin/users/cannot_delete', reason: user_deletion_permission)
  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()
  quota = Pageflow.config.quotas.get(:users, )
  data_attributes = {
    account_id: .id,
    state: quota.state
  }

  render('pageflow/admin/users/quota_state',
         account: ,
         quota: quota,
         data_attributes: data_attributes)
end