Skip to content

chmod

FunctionLists or changes explicit Confluence page restrictions (view / edit) for users and groups.
Options-n, --dry-run — previews changes. -y, --yes — confirms writes.
LimitationsNot Unix modes (no 755). No chown in this release. No space-level permissions or recursive (-R) changes. PATH must be a page. At most 100 paths. Folders are refused.

clear removes explicit restrictions on that page. Listing does not require -y. Writes require -y unless you pass -n.

MODE tokens: read=+u:ACCOUNTID, read=-u:ACCOUNTID, update=+u:ACCOUNTID, update=-u:ACCOUNTID (you cannot remove your own edit restriction), the same +g: / -g: forms for groups, and clear.

If a multi-action run fails partway, Shell reports what was partially applied. Piped stdin is a list of page paths; put only MODE and flags on the command line.

  • On view-restricted pages, edit (update) requires view (read): a person who can edit also holds view, and removing only an editor’s read is rejected by Confluence (HTTP 400). Atlassian is rolling this change out per site, so behavior can differ between sites for a while.
  • Keep yourself in the restriction. When you add restrictions, include your own account together with the other person; otherwise Confluence rejects the write (HTTP 400, “evicts current user”). This applies to group grants too — include read=+u:YOU unless you are sure you are in that group.
  • Shell applies several MODE tokens in one safe order: read add, update add, update remove, read remove. clear is a barrier: diffs are never moved across a clear, only reordered between clear tokens. If the same target is both added and removed in one group, your typed order is kept. When Shell reorders, the output adds note: applied in order: read add, update add, update remove, read remove, and -n previews in the same execution order with the same note.
  • Reordering does not make the run atomic. If a later action fails, earlier successful actions stay applied and the output lists applied / failed / skipped.
  • If Confluence rejects a change with a 4xx other than 401/403/404, Shell adds a hint: line: for “evicts current user” it asks you to include your own account (chmod -y read=+u:YOU read=+u:ID update=+u:YOU update=+u:ID PAGE); otherwise it asks you to add read first and to remove update before read. “Permission denied” is shown only for HTTP 401/403.

YOU is your own Atlassian account ID; ACCOUNTID and GROUPID are the other person’s or group’s Confluence ID, not display names. chmod PATH lists the current u:ACCOUNTID and g:GROUPID entries.

$ chmod ./SecretPage
$ chmod -n read=+u:YOU read=+u:ACCOUNTID ./SecretPage
$ chmod -y read=+u:YOU read=+u:ACCOUNTID ./SecretPage
$ chmod -y read=+u:YOU update=+u:YOU read=+u:ACCOUNTID update=+u:ACCOUNTID ./SecretPage
$ chmod -y update=-u:ACCOUNTID ./SecretPage
$ chmod -y update=-u:ACCOUNTID read=-u:ACCOUNTID ./SecretPage
$ chmod -y read=+u:YOU read=+g:GROUPID ./SecretPage
$ chmod -y clear ./SecretPage
$ find ./folder -name 'Draft*' | chmod -y clear