Module: Account::Onboarding::InvitationListsHelper

Defined in:
app/helpers/account/onboarding/invitation_lists_helper.rb

Instance Method Summary collapse

Instance Method Details

#available_rolesObject

When sending bulk invitations, the current user is the only one with a membership on the team. This means that we can access all of the available roles with the following code.



4
5
6
7
8
# File 'app/helpers/account/onboarding/invitation_lists_helper.rb', line 4

def available_roles
  current_user.memberships.first.roles.map do |role|
    [role.attributes[:key]] + role.attributes[:manageable_roles]
  end.flatten.uniq.reject { |role| role.match?("default") }
end