Skip to main content

forest roles:apply

Apply a wide-format CSV of role permissions, as produced by forest roles:export, to an environment. The CLI compares the file with the current permissions, prints the number of changes per role, and applies them once you confirm.

Usage

Arguments

Options

Behavior

  • Each row updates the role named in its role column. Roles absent from the file keep their permissions.
  • roles:apply updates existing roles only. If a row names a role that does not exist, the command stops before changing anything: create the role first with forest roles:create.
  • Only the columns present in the file are applied: removing a column leaves that permission unchanged, it does not revoke it.
  • Cells must be true or false. The hasConditions columns are read-only and ignored.
  • Permissions are matched by collection and action name, so a file exported from one environment applies to another environment whose schema differs.
  • Running the same file again makes no change. If the command fails halfway, run it again to finish.

Example