Skip to content
Justin Coyne edited this page Dec 6, 2024 · 2 revisions

Access to spotlight is managed via a table roles (Spotlight::Role) in the database.

You can elevate a user to a site-wide super admin by granting this role:

user = User.first
user.superadmin?
# => false

user.roles.create(role: 'admin', resource: Spotlight::Site.instance)
user.superadmin?
# => true

Other access is granted per-exhibit.

exhibit = Spotlight::Exhibit.first
user.roles.create(role: 'admin', resource: exhibit)

The available roles are in Spotlight::Engine.config.exhibit_roles

Spotlight::Engine.config.exhibit_roles
# => ["admin", "curator", "viewer"]