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 kind | Roles, strongest first | Decides who may change |
|---|---|---|
| Household role | owner, manager, member | the catalog: items, tags, vendors, recipes, shelves |
| Location role | organizer, participant, viewer | one location’s stock, carts and cooking |
| Person | Catalog | Stock, carts, cooking at a location |
|---|---|---|
| household owner or manager | may change | depends on their location role there |
| household member | read only | depends on their location role there |
| location organizer or participant | depends on their household role | may change |
| location viewer | depends on their household role | read 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?
| Shape | When | What the person sees |
|---|---|---|
| Hide | the control only starts a change (a button, a menu item) | no control; one line of text that says why |
| Disable | the 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.
| Person | Under the search row |
|---|---|
| owner or manager | the Create item button. Enter also creates |
| member | no 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:
| Where | Hidden for | The note (EN) | Key |
|---|---|---|---|
| Cooking, search | member | ”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 button | viewer | ”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.
| Control | For a viewer |
|---|---|
| each row’s checkbox | shown, disabled. It still shows which items are in the cart |
| each row’s amount button | shown, disabled. It still shows how much |
| Cancel and Done | hidden. 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.
| State | Write controls | The note |
|---|---|---|
| role unknown | hidden (the safe default) | not shown |
| role known, may write | shown | not shown |
| role known, may not write | hidden or disabled | shown |
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:
- Show the parts they may not change read only, with the note that says why, inside the dialog, next to those parts.
- 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
FORBIDDENerror. - 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
| Rule | How the app does it today |
|---|---|
| A disabled control keeps its accessible name | the 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 note | on 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 text | ReadOnlyNote 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 controls | the cart and cooking checkboxes and the amount buttons use the HTML disabled attribute. They leave the Tab order |
aria-disabled for pressable badges | on 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 readable | form 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.