Skip to content

Permissions and read-only

A person sees what they may read. A control they may not use is hidden, or turned off when it also shows data. A short note says why.

This page is for people who design screens. It gives the rules and a few real examples. The full list, page by page, is in apps/web/src/routes/CLAUDE.md, section Read-only views by role. The item Stock tab is in apps/web/src/routes/items/CLAUDE.md.


Who may do what

Roles exist in cloud mode only. Local mode has one person and no roles, so every control shows.

There are two kinds of role. They are two separate checks.

Role kindRoles, strongest firstDecides who may change
Household roleowner, manager, memberthe catalog: items, tags, vendors, recipes, shelves
Location roleorganizer, participant, viewerone location’s stock, carts and cooking
PersonCatalogStock, carts, cooking at a location
household owner or managermay changedepends on their location role there
household memberread onlydepends on their location role there
location organizer or participantdepends on their household rolemay change
location viewerdepends on their household roleread only

So one person can be a household manager who may edit the catalog, and also a viewer of one location who may not change its stock. Design for both rights at once.

A few writes need a stronger role. For example, only an organizer may remove an item from a location, because that also deletes other people’s logs.

The app only hides. The server checks every write. Hiding a control keeps a person from pressing a button that would fail. It is not the protection.


Two shapes

The app uses two shapes. Pick one by asking: does the control also show data?

ShapeWhenWhat the person sees
Hidethe control only starts a change (a button, a menu item)no control; one line of text that says why
Disablethe control also shows data (a checkbox that shows “in the cart”, an amount, a field value)the control, turned off; one line of text that says why

Never hide a control that holds data. The person would lose the data, not only the action.

Hide: a household member and “Create item”

A household member searches the pantry for “oat milk”. No item has that name.

PersonUnder the search row
owner or managerthe Create item button. Enter also creates
memberno button. Enter does nothing. The line: “Only a household owner or manager can create a new item.” (items.createReadOnly)

The note shows with the same trigger as the button it replaces: a search with no exact match.

More examples of this shape:

WhereHidden forThe note (EN)Key
Cooking, searchmember”Only a household owner or manager can create a new recipe.”cookingControlBar.createReadOnly
Search tail, group action (Apply vendor, Add to recipe, Add to shelf)member”Only an owner or manager can add it here.”items.searchTail.catalogReadOnly
Settings lists (tags, vendors, recipes, shelves)member”Only a household owner or manager can add or change these.”settings.catalogReadOnly
Pantry, Add button and quick update buttonviewer”You can view this location, but not change it.” (on the empty pantry, and under the search row)common.locationViewOnly

Disable: a location viewer on a cart page

A viewer opens the Costco cart of a location.

ControlFor a viewer
each row’s checkboxshown, disabled. It still shows which items are in the cart
each row’s amount buttonshown, disabled. It still shows how much
Cancel and Donehidden. They only start a change
the note above the list”You can view this location, but not change it.” (common.locationViewOnly)

The cooking page works the same way: the recipe and item checkboxes are disabled, Cancel and Done are hidden, and the same note shows.

Forms use the same shape. A member on an item’s Info tab sees every field read only, no Save and no Delete, and the note “Only a household owner or manager can change this.” (settings.catalogReadOnlyItem) above the form. A viewer on the item’s Stock tab sees the numbers read only, and the steppers, Pack, Unpack, Clear and Fill to Full disabled.


While the role is unknown

The role comes from the server. For a short time it is not known yet. It can also stay unknown when the read failed and nothing was saved before.

StateWrite controlsThe note
role unknownhidden (the safe default)not shown
role known, may writeshownnot shown
role known, may not writehidden or disabledshown

Do not show the note while the role is unknown. For an owner it would be untrue. In code this is roleKnown from usePermissions().


A dialog with parts the person may not change

This is the rule going forward (owner decision, 2026-12-01).

Some dialogs can be opened by a person who may change part of them but not all of it. Design them like this:

  1. Show the parts they may not change read only, with the note that says why, inside the dialog, next to those parts.
  2. If the dialog’s main action would need a right the person does not have, turn off the submit button before any save. Do not let the person press it and then show the server’s FORBIDDEN error.
  3. If the person may still save the other parts, keep the submit button on, and leave the read-only parts out of the save.

An example that follows point 1 and point 3 today: the pantry quick edit dialog. For a household member, its Stock settings section still opens, but Consumable, Package Unit and Amount per Consume are read only, with “Only a household owner or manager can change this.” at the top of the section. The stock numbers stay editable where the member is a participant or higher, and no setting is ever sent.

Built (shelf consumable PR B, not yet released): point 2 in the Add to shelf dialog of the consumable shelf filter (design: docs/features/shelf/2026-12-01-shelf-filter-consumable-design.md, decision C33). When “Mark as not consumable” would convert the item’s stock at a location where the person is only a viewer, that location’s row is read only with “You can view this location, but not change it.”, and Add is off before any press. The quick edit confirm and the item Info tab dialog follow the same rule (PR E). On a filter shelf’s Filters tab a household member sees the Consumable choice turned off, and each radio names the read-only note.


Accessibility

RuleHow the app does it today
A disabled control keeps its accessible namethe cart checkbox is still named “Add Milk” or “Remove Milk”; the amount button is still “Edit amount of Milk: 2 pack”
A disabled control points at the noteon the cart and cooking pages, the note has an id, and each disabled checkbox and amount button names it in aria-describedby. Only for a known viewer, because the note renders only then
The note is real textReadOnlyNote is a <p> with an eye icon (aria-hidden) and the text. Never a tooltip: a tooltip needs a hover or a focus, and a disabled control gets neither
Native disabled for real form controlsthe cart and cooking checkboxes and the amount buttons use the HTML disabled attribute. They leave the Tab order
aria-disabled for pressable badgeson the item Tags, Vendors and Recipes tabs, a member sees badges with aria-disabled="true". They are not in the Tab order, and a press changes nothing. Badges are role="button" elements, not form controls, so they use the ARIA attribute
Read-only fields stay readableform fields a person may not change use readOnly where the field type allows it, so the value can still be selected and read

A disabled control is out of the Tab order, so a keyboard user does not land on it. They read the note as normal page text, the same way a screen reader user does when they read the page in order.


Checklist for a new screen

  • Which role kind decides each control: household, location, or both?
  • Does the control also show data? Then disable it. Else hide it.
  • Is there one line of text that says why? Use the existing keys above when they fit.
  • Is the note hidden while the role is unknown?
  • In a dialog: are the parts the person may not change read only, and is submit off before any save when the main action needs a missing right?
  • Does every disabled control keep its name, and name the note in aria-describedby?
  • Remember: the server must refuse the write too. The screen is not the check.