Sha256: 01394f3060e9a5e173b0fd29567bbf6c542a7eb393fcf350f99ad74000deaf16

Contents?: true

Size: 451 Bytes

Versions: 84

Compression:

Stored size: 451 Bytes

Contents

module Account::Onboarding::InvitationListsHelper
  # 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.
  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
end

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
bullet_train-1.4.7 app/helpers/account/onboarding/invitation_lists_helper.rb
bullet_train-1.4.6 app/helpers/account/onboarding/invitation_lists_helper.rb
bullet_train-1.4.5 app/helpers/account/onboarding/invitation_lists_helper.rb
bullet_train-1.4.4 app/helpers/account/onboarding/invitation_lists_helper.rb