Visibility and Permissions - UVicLibrary/Vault GitHub Wiki

Cheatsheet (Jump to)

Hyku/Vault generally has two settings in terms of visibility, public (viewable by anyone on the internet) and private (viewable only by those who have been given access).

However, you can also restrict access to people who

  • are affiliated with UVic
  • you invite individually by email
  • have a specific role within your site, i.e. admin or cataloguer. You can (re)assign a user to a role at any time (see below).

For all the items in a collection to be viewable, browseable, and searchable by public users, all its works and file sets must be public. Unintentionally leaving works or file sets private results in scenarios where public users can see the metadata for the collection/work but not the file itself. Also, a collection or work must be public before it can be featured on the home page. See the Featured Collections, Works, or Researchers page for more about featuring items.

To avoid this issue, we recommend publishing items at the collection level using the "Make Public" or "Make Private" button. This will set all its works and file sets to public.

To find the button, go to Dashboard > Collection > [Click a collection] > Make Public or Make Private. This process can take a while so Vault will email you when it's finished.

Toolbar for setting visibility of a collection

Managing Permissions for Specific Users

Roles (vs. Groups)

In Hyku, only roles involve any change in permissions. You can organize users into groups, where each group has its own title and description, but adding or removing users from a group does not affect their access to a site. The two roles available are admin and cataloguer.

Note: In the following table, "manage" means the ability to create, edit, and delete.

Admins Cataloguers
✔ manage collections, works, file sets, and admin sets ✔ manage collections, works, file sets, and admin sets
✔ edit site options such as labels, masthead, content blocks ❌ edit site options
✔ manage roles or groups ❌ manage roles or groups

To see current users' roles, go to Dashboard > Manage Users.

To assign a role to a user, go to Dashboard > Manage Users > Edit Permissions.

Find a user by their email address and click/select the role(s) you would like to assign to them. Click "Save changes."

Screenshot of the manage users page

Troubleshooting Visibility Problems

If you're unable to see, search, or download an item as a public user (i.e. when logged out), double-check that the relevant collection, work, and file set are all set to public. Using the "Make Public" and "Make Private" buttons for a collection prevent this issue from happening.

You can also refer to the table below describing visibility errors, which refers to what a public user can or cannot see. Look along the "Result" column to find the description that best fits your situation, and then look at the rest of the row to determine which item (collection, work, or file set) needs to be made public.

Collection Work File Set Result
Is Visible? You can visit the collection's page but it has 0 items.
Is Visible? You can visit the page for a collection and a work, but the viewer either hangs while loading or displays an error.
Is Visible? You can see the work's page but not the collection's page. The collection doesn't appear on the home page's "All Collections" table. On the work's page, you can't view the file (viewer is loading forever or displays an error).

Notes for Developers

Related Files

  • config/routes: routes for controller actions
  • controllers/hyrax/dashboard/collections_controller: triggers the change_coll_visibility job
  • jobs/hyrax/change_coll_visibility_job: where the visibility actually changes
  • In views/hyrax/dashboard/collections:
    • show_actions: "make public" and "make private" buttons
    • flash_msg.js.erb: renders _public_or_private_msg
    • _public_or_private_msg: notifies the user that the visibility job has been enqueued
  • mailers/notification_mailer: emails user saying that the job is done
  • views/notification_mailer/email_notification: html and text templates for the email sent with above mailer

General Overview

What happens when you click the "make public" or "make private" button?

  1. The button triggers a POST action to collections_controller#change_coll_visibility, which does 2 things:
    • starts a job Hyrax::ChangeCollVisibilityJob.perform_later(params[:id], user_email, visibility, request.base_url)
    • Ajax call to render a message notifying the user
  2. The Change Visibility job takes 4 parameters:
    • the ID of the collection to change
    • the user's (who clicked the button) email address
    • a string that is either "public" or "private" depending on what the visibility of the collection should be
    • the base url or domain name that's needed for the mailer's host email address (the "From" field)
  3. The last line of the job emails the user that the job is finished
    • ::NotificationMailer.with(account_host: host, user_email: user_email, id: collection_id, visibility: visibility).email_notification.deliver
⚠️ **GitHub.com Fallback** ⚠️