Jumpstart docs logo Back to the app

Roles

Admins

Users with the admin flag set to true will be allowed to access the application's admin interface, Sidekiq web UI, and more.

To set a user as an admin, simply update their admin flag: Jumpstart.grant_system_admin! user from the Rails console.

You can check this flag if you would like to restrict any functionality only to admin users.

Account Roles

Users can be assigned a role for each account they are a part of. By default, we only provide an admin role, but you can add more rules in app/models/account_user.rb. These roles will be listed in the UI when adding or editing a account member.

You can check the role on the account member to restrict access to certain functionality on the account as needed.

Users can be assigned a role for each account they are a part of. By default, we only provide an admin role, but you can add more roles in app/models/account_user.rb. These roles will be listed in the UI when adding or editing a account member. You should not use a reserved word (like "user") as the name of a role; this will cause an error when attempting to create an account.

You can check the role on the account member to restrict access to certain functionality on the account as needed.

To access the current account member or roles, you can use the following helpers in your controllers and views:

Current.account_user #=> AccountUser
Current.roles #=> [:admin]

You can also access the roles individually on the AccountUser model:

account_user = AccountUser.new
account_user.admin? #=> false
account_user.admin = true
account_user.admin? #=> true
account_user.active_roles #=> [:admin]