Skip to main content

Work as a job role

See how one person can work as Case worker or Reference data administrator, and how changing jobs changes the work they can open. Read the two job-role files, switch jobs, and check both an allowed page and a refused route.

This is a separate exercise in the platform's generic sample application, using invented records. It does not continue editing the permit desk. Ask the environment owner for a disposable sample instance already prepared with a person holding both jobs and its matching source checkout. Use the existing approved sign-in method. This lesson does not create an account, assign roles or change permissions. A fresh blank scaffold or an administrator with different roles is not this fixture.

Read the two jobs​

A resource role supplies permissions. A job role groups resource roles into a job someone can work as. A person must already hold every required resource role before they can select that job; adding a job-role file does not grant those roles.

In the platform source checkout, read sample-appeals/src/main/resources/jcm/job-roles/job.case-worker.yml:

code: job.case-worker
name: Case worker
resource-roles: [case-worker]
home: dashboard:db.appeal.worker

Then read sample-appeals/src/main/resources/jcm/job-roles/job.refdata-admin.yml:

code: job.refdata-admin
name: Reference data administrator
resource-roles: [jcm-refdata-admin]

These are examples to inspect, not files to copy into the permit desk. The first job names a worker dashboard as its home. The second has no explicit home; the platform chooses an available destination. In this prepared sample that is the no-work page. A different application's role definitions may lead somewhere else.

While a job is active, the UI keeps that job's resource roles and the person's roles that belong to no job. Roles belonging to their other jobs are dropped. The person's own row-level restrictions remain. This narrowing applies to the Vaadin UI; it is not a claim about another API, tenant boundary or identity provider. See the job-role reference for those rules.

Open the two files in the matching source checkout. Confirm the job names and resource-role lists above. If this prepared instance differs, stop and reconcile its source and role setup with the environment owner before following the route checks.

Open work as Case worker​

Sign in to the prepared sample. Find Working as before the user menu. Select Case worker if it is not already active. Wait for the application to reload. Open Inbox and confirm that work queues appear. Record the active job and the visible queue names without copying case records or sign-in details.

The initial job is the person's configured default, otherwise the first available job in the application's order. One available job is shown as plain text; no available jobs means there is no switcher. If you see either of those situations, you do not have the two-job fixture needed for this exercise. Do not broaden access to make the control appear. The platform installs the control in the shell; adding one to MainView is unnecessary.

Switch jobs and check the boundary​

Finish or discard any edits before switching. A job switch reloads the application and takes you to the new job's home. Other open tabs in the same session act under the new job from their next request, so do not use a second tab as a way to keep the previous job's access.

Use Tab to focus Working as. Open its options with the keyboard, choose Reference data administrator, and confirm the choice. Wait for the reloaded page and check the selected job again. In this sample the no-work page appears and Inbox is absent from the menu. Record those observations.

A missing menu item alone does not establish that its route is protected. Test the route as well:

In the same browser tab and on the same sample origin, navigate directly to /jcm/inbox. Confirm the navigation is refused and no work queues are displayed. Record the refusal. If the Inbox opens, stop: this instance differs from the exercise's expected access boundary. Do not treat the earlier menu change as a pass.

The existing platform fixture expects the message Could not navigate to 'jcm/inbox'. Record the actual result rather than treating any blank page or unrelated error as a successful refusal.

Return to the worker job​

Return to the sample's home on the same origin. Use Working as to select Case worker again, wait for the reload, then open Inbox. Confirm that the worker queues are available again. Record this allowed result alongside the refused result from the other job.

You have observed one person's UI access under two existing jobs. That does not prove record-level confidentiality, all action permissions, other users' access, or production identity setup. Keep a small exercise record: source revision, prepared sample, the two jobs, the allowed and refused routes, keyboard observations and any unexpected result. A screenshot and accessibility scan can support that record; an automatic scan does not replace the route checks or keyboard exercise.

The platform test JobRoleSwitcherE2eTest.switchingChangesTheMenuAndTheQueuesWithTheHome checks the switch to the reference-data job and direct Inbox refusal in a synthetic fixture. Its result is separate from your manual exercise and from application-wide security approval. For the continuing permit example, return to Write a letter.