Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit914f35a

Browse files
authored
chore: document RBAC usage (#14065)
1 parent328e696 commit914f35a

File tree

2 files changed

+420
-7
lines changed

2 files changed

+420
-7
lines changed

‎coderd/rbac/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#Authz
22

3-
Package`authz` implementsAuthoriZation for Coder.
3+
Package`rbac` implementsRole-Based Access Control for Coder.
44

55
##Overview
66

77
Authorization defines what**permission** a**subject** has to perform**actions** to**objects**:
88

99
-**Permission** is binary:_yes_ (allowed) or_no_ (denied).
10-
-**Subject** in this case is anything that implements interface`authz.Subject`.
11-
-**Action** here is an enumerated list of actions, but we stick to`Create`,`Read`,`Update`,and`Delete` here.
12-
-**Object** here is anything that implements`authz.Object`.
10+
-**Subject** in this case is anything that implements interface`rbac.Subject`.
11+
-**Action** here is an enumerated list of actions. Actions can differ for each object type. They typically read like,`Create`,`Read`,`Update`,`Delete`, etc.
12+
-**Object** here is anything that implements`rbac.Object`.
1313

1414
##Permission Structure
1515

@@ -38,7 +38,7 @@ This can be represented by the following truth table, where Y represents _positi
3838
| read| Y|\_| Y|
3939
| read| Y| N| N|
4040
| read|\_|\_|\_|
41-
| read|\_| N|Y|
41+
| read|\_| N|N|
4242

4343
##Permission Representation
4444

@@ -49,11 +49,11 @@ This can be represented by the following truth table, where Y represents _positi
4949
-`object` is any valid resource type.
5050
-`id` is any valid UUID v4.
5151
-`id` is included in the permission syntax, however only scopes may use`id` to specify a specific object.
52-
-`action` is`create`,`read`,`modify`,or`delete`.
52+
-`action` istypically`create`,`read`,`modify`,`delete`, but you can define other verbs as needed.
5353

5454
##Example Permissions
5555

56-
-`+site.*.*.read`: allowed to perform the`read` action against all objects of type`app` in a given Coder deployment.
56+
-`+site.app.*.read`: allowed to perform the`read` action against all objects of type`app` in a given Coder deployment.
5757
-`-user.workspace.*.create`: user is not allowed to create workspaces.
5858

5959
##Roles
@@ -106,7 +106,9 @@ You can test outside of golang by using the `opa` cli.
106106

107107
**Evaluation**
108108

109+
```bash
109110
opaeval --format=pretty"data.authz.allow" -d policy.rego -i input.json
111+
```
110112

111113
**Partial Evaluation**
112114

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp