For the complete documentation index, see llms.txt. This page is also available as Markdown.

Edit a policy

Change a policy's permission statements, or look at a system policy.

Where: Membership → Policies → click a policy · /projects/<project>/membership/policies/<policyId>/edit

Before you start

  • The policy exists — see Create a policy. System policies open read only.

  • You need the membership:update permission on policies.

Steps

  1. Under Custom Policies, click the policy, for example orders-read. The screen Editing policy opens with the saved document. It now has a pid key with the policy id (pol_1oRlzIGnF3lzemVoX1nwyy) — leave it in place.

    Editing policy orders-read with the saved document and its pid
    The saved document.
  2. Change the document, for example add the invoices collection to resources and change description.

    Key
    What you change
    Example

    description

    The text.

    Read every order and invoice in the database.

    permissions[].resources

    Add or remove items.

    …:database:collection:invoices

    The edited document with two resources, orders and invoices; Policy document is valid against the schema
    The changed document, valid.
  3. Press Save.

A System policy opens as Displaying system policy: the document is shown as a read only tree, with Cancel only.

Displaying system policy Membership — full access: allow membership:* on *:*:membership:*:*, pid pol_3lDsaoP8uCtr50wYpCQw7R
A system policy, read only.

Result

Cloud goes back to Policies. The new permissions apply at once to every role — and through the roles, every user — that carries the policy.

Change or remove it later

Do it from code

document and id come from the create example; send the whole document, it replaces the old one. The client setup is on the Membership page. API: Update Policy · Get Policy

Last updated

Was this helpful?