Skip to content

Commit 4cc8e9f

Browse files
committed
[Workers] Add per-resource permissions docs for fine-grained Worker acce
1 parent 3269372 commit 4cc8e9f

File tree

10 files changed

+535
-2
lines changed

10 files changed

+535
-2
lines changed
16.1 KB
Loading
13.9 KB
Loading
11.1 KB
Loading
15.2 KB
Loading
13.1 KB
Loading

src/content/docs/fundamentals/manage-members/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Every policy has three parts:
2121

2222
Refer to the resources below to configure policies to ensure that you can assign only the necessary access permissions to your account members.
2323

24+
To restrict access to individual resources (like specific Workers), refer to [Per-resource permissions](/fundamentals/manage-members/per-resource-permissions/).
25+
2426
## Resources
2527

2628
<DirectoryListing />

src/content/docs/fundamentals/manage-members/per-resource-permissions.mdx

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

src/content/docs/fundamentals/manage-members/roles.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,24 @@ Domain-scoped roles apply for a given domain within an account.
109109

110110
## Resource-scoped roles
111111

112-
Resource-scoped roles apply for a specific resource within an account.
112+
Resource-scoped roles apply to a specific resource within an account, such as an individual Worker or Access application. Use resource-scoped roles with [per-resource permissions](/fundamentals/manage-members/per-resource-permissions/) to restrict access to individual resources.
113113

114114
:::note
115115
Resource-scoped roles is currently in Beta.
116116
:::
117117

118+
### Workers
119+
120+
| Role | Description |
121+
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
122+
| Worker Admin | Can manage a single Cloudflare [Worker](/workers/) resource. Grants full read, edit, deploy, and delete access. |
123+
| Worker Edit (Versions & Deployments) | Can update a single Cloudflare [Worker](/workers/) resource. Grants access to create new versions and deployments, but not to delete or change Worker-level settings. |
124+
| Worker Read | Can read a single Cloudflare [Worker](/workers/) resource. View-only access to the Worker, its configuration, versions, and deployments. |
125+
126+
For a walkthrough of restricting access to individual Workers, refer to [Per-resource permissions](/fundamentals/manage-members/per-resource-permissions/).
127+
128+
### Access
129+
118130
| Role | Description |
119131
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
120132
| Cloudflare Access App Admin | Can edit a specific [Access application](/cloudflare-one/access-controls/applications/) in an account. |

src/content/docs/fundamentals/manage-members/scope.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ If you want the member to have a policy that applies to a specific resource, use
102102

103103
You can assign the following resource-specific scopes to members:
104104

105-
| Scope | Description |
105+
| Scope | Description |
106106
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
107+
| Individual Workers | Grant access to manage a specific [Worker](/workers/). Refer to [Per-resource permissions](/fundamentals/manage-members/per-resource-permissions/) for a setup guide. |
107108
| Individual Access applications | Grant access to manage a specific [Access application](/cloudflare-one/access-controls/applications/). |
108109
| Individual Access identity providers (IdPs) | Grant access to manage a specific [Cloudflare One identity provider (IdP)](/cloudflare-one/integrations/identity-providers/). |
109110
| Individual Access policies | Grant access to manage a specific [Access policy](/cloudflare-one/access-controls/policies/). |
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
pcx_content_type: reference
3+
title: Permissions and access
4+
sidebar:
5+
order: 7
6+
description: Roles and permissions for managing Workers on your Cloudflare account.
7+
---
8+
9+
When you add members to your Cloudflare account, you control what they can do with Workers by assigning [roles](/fundamentals/manage-members/roles/) and [scopes](/fundamentals/manage-members/scope/) through [permission policies](/fundamentals/manage-members/policies/).
10+
11+
## Account-wide roles
12+
13+
These roles apply to **all Workers** (and other developer platform resources) on the account:
14+
15+
| Role | Access level | Description |
16+
| --- | --- | --- |
17+
| Workers Platform Admin | Read and edit | Can create, update, deploy, and delete all Workers, [Pages](/pages/) projects, [KV](/kv/) namespaces, [R2](/r2/) buckets, [Durable Objects](/durable-objects/), and other developer platform resources. |
18+
| Workers Platform (Read-only) | Read only | Can view all Workers and other developer platform resources but cannot make changes. |
19+
20+
These roles also cover [Pages](/pages/), [Durable Objects](/durable-objects/), [KV](/kv/), [R2](/r2/), [Zone Analytics](/analytics/account-and-zone-analytics/zone-analytics/), and [Page Rules](/rules/).
21+
22+
## Per-Worker roles
23+
24+
:::note
25+
Per-Worker roles are currently in beta.
26+
:::
27+
28+
Per-Worker roles let you grant a member edit access to **specific Workers** instead of all Workers on the account. This is useful when you need to restrict who can deploy to production-critical Workers (like a payment service or authentication gateway) while allowing broader access to general-purpose Workers.
29+
30+
| Role | Access level | Description |
31+
| --- | --- | --- |
32+
| Worker Admin | Full manage | Can manage a single Worker. Grants full read, edit, deploy, and delete access. |
33+
| Worker Edit (Versions & Deployments) | Deploy | Can update a single Worker. Grants access to create new versions and deployments, but not to delete or change Worker-level settings. |
34+
| Worker Read | Read only | Can read a single Worker. View-only access to the Worker, its configuration, versions, and deployments. |
35+
36+
### How per-Worker permissions work
37+
38+
1. Assign the **Workers Platform (Read-only)** role at the account level so the member can view all Workers in the dashboard.
39+
2. Assign a per-Worker role (such as **Worker Edit (Versions & Deployments)**) scoped to the individual Workers the member should be able to modify.
40+
41+
The member can then view all Workers but can only deploy to or modify the Workers you explicitly selected.
42+
43+
For a full walkthrough of setting this up — including User Groups, dashboard steps, API examples, and Terraform — refer to [Per-resource permissions](/fundamentals/manage-members/per-resource-permissions/).
44+
45+
### Wrangler and per-Worker roles
46+
47+
Wrangler support for per-Worker permissions is in progress. Most `wrangler` commands work when the member has per-Worker edit access and the account-wide **Workers Platform (Read-only)** role:
48+
49+
- **`wrangler deploy`** (existing Worker) — works with per-Worker edit access. If the Worker has [routes](/workers/configuration/routing/routes/), the member also needs zone-level permissions for the zones referenced by those routes.
50+
- **`wrangler deploy`** (new Worker) — requires **Workers Platform Admin**. You cannot have per-Worker access to a Worker that does not exist yet.
51+
- **`wrangler versions upload`**, **`wrangler versions deploy`**, **`wrangler rollback`** — work with per-Worker edit access.
52+
- **`wrangler secret put`**, **`wrangler secret delete`**, **`wrangler secret bulk`** — work with per-Worker edit access.
53+
- **`wrangler tail`**, **`wrangler deployments list`**, **`wrangler versions list`** — work with per-Worker read access.
54+
55+
## Required roles for common tasks
56+
57+
| Task | Minimum role required |
58+
| --- | --- |
59+
| View Workers in the dashboard | Workers Platform (Read-only) |
60+
| Deploy an existing Worker with Wrangler | Workers Platform (Read-only) + Worker Edit (Versions & Deployments) (per-Worker) |
61+
| Create a new Worker | Workers Platform Admin |
62+
| Delete a Worker | Workers Platform Admin (account-wide) or Worker Admin (per-Worker) |
63+
| Edit environment variables and secrets | Workers Platform Admin (account-wide) or Worker Admin (per-Worker) |
64+
| Manage versions and deployments | Worker Edit (Versions & Deployments) (per-Worker) |
65+
| View Logpush configuration | [Log Share Reader](/fundamentals/manage-members/roles/#account-scoped-roles) |
66+
| Edit Logpush configuration | [Log Share](/fundamentals/manage-members/roles/#account-scoped-roles) |
67+
68+
## API tokens
69+
70+
[API tokens](/fundamentals/api/get-started/create-token/) are separate from member roles. When creating an API token, you can scope it to specific permissions and resources.
71+
72+
For Workers, the relevant API token permission groups are:
73+
74+
| Permission | Access |
75+
| --- | --- |
76+
| Workers Scripts Read | Can read Worker scripts and metadata. |
77+
| Workers Scripts Edit | Can create, update, and delete Worker scripts. |
78+
79+
:::note
80+
Account-owned API tokens do not yet support per-resource scoping. You cannot restrict an account-owned API token to a specific Worker. This will be supported in a future release. User-level API tokens can be scoped to specific accounts and zones but not to individual Workers.
81+
:::
82+
83+
## Related resources
84+
85+
- [Per-resource permissions](/fundamentals/manage-members/per-resource-permissions/) — end-to-end guide to restricting access to individual Workers.
86+
- [Roles](/fundamentals/manage-members/roles/) — full list of all roles.
87+
- [Role scopes](/fundamentals/manage-members/scope/) — account, domain, and resource-level scopes.
88+
- [User Groups](/fundamentals/manage-members/user-groups/) — group members with shared permissions.
89+
- [API token permissions](/fundamentals/api/reference/permissions/) — permissions for API tokens.

0 commit comments

Comments
 (0)