You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: coderd/apidoc/docs.go
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -726,7 +726,7 @@ const docTemplate = `{
726
726
]
727
727
},
728
728
"object": {
729
-
"description": "Object can represent a \"set\" of objects, such as:\n\t- All workspaces in an organization\n\t- All workspaces owned by me\n\t- All workspaces across the entire product\nWhen defining an object, use the most specific language when possible to\nproduce the smallest set. Meaning to set as many fields on 'Object' as\nyou can. Example, if you want to check if you can update all workspaces\nowned by 'me', try to also add an 'OrganizationID' to the settings.\nOmitting the 'OrganizationID' could produce the incorrect value, as\nworkspaces have both `+"`"+`user`+"`"+` and `+"`"+`organization`+"`"+` owners.",
729
+
"description": "Object can represent a \"set\" of objects, such as: all workspaces in an organization, all workspaces owned by me, all workspaces across the entire product.",
"description": "OrganizationID (optional) is an organization_id. It adds the set constraint to\nall resources owned by a given organization.",
738
+
"description": "Organization ID (optional) adds the set constraint to all resources owned by a given organization.",
739
739
"type": "string"
740
740
},
741
741
"owner_id": {
742
-
"description": "OwnerID (optional) is a user_id. It adds the set constraint to all resources owned\nby a given user.",
742
+
"description": "OwnerID (optional) adds the set constraint to all resources owned by a given user.",
743
743
"type": "string"
744
744
},
745
745
"resource_id": {
746
-
"description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the 'OwnerID' and 'OrganizationID'\nif possible. Be as specific as possible using all the fields relevant.",
746
+
"description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the `+"`"+`OwnerID`+"`"+` and `+"`"+`OrganizationID`+"`"+`\nif possible. Be as specific as possible using all the fields relevant.",
Copy file name to clipboardExpand all lines: coderd/apidoc/swagger.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -642,7 +642,7 @@
642
642
"enum": ["create", "read", "update", "delete"]
643
643
},
644
644
"object": {
645
-
"description": "Object can represent a \"set\" of objects, such as:\n\t- All workspaces in an organization\n\t- All workspaces owned by me\n\t- All workspaces across the entire product\nWhen defining an object, use the most specific language when possible to\nproduce the smallest set. Meaning to set as many fields on 'Object' as\nyou can. Example, if you want to check if you can update all workspaces\nowned by 'me', try to also add an 'OrganizationID' to the settings.\nOmitting the 'OrganizationID' could produce the incorrect value, as\nworkspaces have both `user` and `organization` owners.",
645
+
"description": "Object can represent a \"set\" of objects, such as: all workspaces in an organization, all workspaces owned by me, all workspaces across the entire product.",
"description": "OrganizationID (optional) is an organization_id. It adds the set constraint to\nall resources owned by a given organization.",
654
+
"description": "Organization ID (optional) adds the set constraint to all resources owned by a given organization.",
655
655
"type": "string"
656
656
},
657
657
"owner_id": {
658
-
"description": "OwnerID (optional) is a user_id. It adds the set constraint to all resources owned\nby a given user.",
658
+
"description": "OwnerID (optional) adds the set constraint to all resources owned by a given user.",
659
659
"type": "string"
660
660
},
661
661
"resource_id": {
662
-
"description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the 'OwnerID' and 'OrganizationID'\nif possible. Be as specific as possible using all the fields relevant.",
662
+
"description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the `OwnerID` and `OrganizationID`\nif possible. Be as specific as possible using all the fields relevant.",
Copy file name to clipboardExpand all lines: codersdk/authorization.go
+10-15Lines changed: 10 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -23,35 +23,30 @@ type AuthorizationRequest struct {
23
23
// AuthorizationCheck is used to check if the currently authenticated user (or
24
24
// the specified user) can do a given action to a given set of objects.
25
25
typeAuthorizationCheckstruct {
26
-
// Object can represent a "set" of objects, such as:
27
-
// - All workspaces in an organization
28
-
// - All workspaces owned by me
29
-
// - All workspaces across the entire product
30
-
// When defining an object, use the most specific language when possible to
31
-
// produce the smallest set. Meaning to set as many fields on 'Object' as
32
-
// you can. Example, if you want to check if you can update all workspaces
33
-
// owned by 'me', try to also add an 'OrganizationID' to the settings.
34
-
// Omitting the 'OrganizationID' could produce the incorrect value, as
35
-
// workspaces have both `user` and `organization` owners.
26
+
// Object can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me, all workspaces across the entire product.
36
27
ObjectAuthorizationObject`json:"object"`
37
28
// Action can be `create`, `read`, `update`, or `delete`
|`organization_id`| string | false | none | Organization id (optional) is an organization_id. It adds the set constraint to<br>all resources owned by a given organization. |
51
-
|`owner_id`| string | false | none | Owner id (optional) is a user_id. It adds the set constraint to all resources owned<br>by a given user. |
52
-
|`resource_id`| string | false | none | Resource id (optional) reduces the set to a singular resource. This assigns<br>a resource ID to the resource type, eg: a single workspace.<br>The rbac library will not fetch the resource from the database, so if you<br>are using this option, you should also set the 'OwnerID' and 'OrganizationID'<br>if possible. Be as specific as possible using all the fields relevant. |
50
+
|`organization_id`| string | false | none | Organization ID (optional) adds the set constraint toall resources owned by a given organization.|
51
+
|`owner_id`| string | false | none | Owner id (optional) adds the set constraint to all resources ownedby a given user.|
52
+
|`resource_id`| string | false | none | Resource id (optional) reduces the set to a singular resource. This assigns<br>a resource ID to the resource type, eg: a single workspace.<br>The rbac library will not fetch the resource from the database, so if you<br>are using this option, you should also set the `OwnerID` and `OrganizationID`<br>if possible. Be as specific as possible using all the fields relevant. |
53
53
|`resource_type`| string | false | none | Resource type is the name of the resource.<br>`./coderd/rbac/object.go` has the list of valid resource types. |
0 commit comments