@@ -76,23 +76,23 @@ type UserRoles struct {
76
76
OrganizationRoles map [uuid.UUID ][]string `json:"organization_roles"`
77
77
}
78
78
79
- type UserPermissionCheckResponse map [string ]bool
79
+ type UserAuthorizationResponse map [string ]bool
80
80
81
- // UserPermissionCheckRequest is a structure instead of a map because
81
+ // UserAuthorizationRequest is a structure instead of a map because
82
82
// go-playground/validate can only validate structs. If you attempt to pass
83
83
// a map into 'httpapi.Read', you will get an invalid type error.
84
- type UserPermissionCheckRequest struct {
84
+ type UserAuthorizationRequest struct {
85
85
// Checks is a map keyed with an arbitrary string to a permission check.
86
86
// The key can be any string that is helpful to the caller, and allows
87
87
// multiple permission checks to be run in a single request.
88
88
// The key ensures that each permission check has the same key in the
89
89
// response.
90
- Checks map [string ]UserPermissionCheck `json:"checks"`
90
+ Checks map [string ]UserAuthorization `json:"checks"`
91
91
}
92
92
93
- // UserPermissionCheck is used to check if a user can do a given action
93
+ // UserAuthorization is used to check if a user can do a given action
94
94
// to a given set of objects.
95
- type UserPermissionCheck struct {
95
+ type UserAuthorization struct {
96
96
// Object can represent a "set" of objects, such as:
97
97
// - All workspaces in an organization
98
98
// - All workspaces owned by me
@@ -103,12 +103,12 @@ type UserPermissionCheck struct {
103
103
// owned by 'me', try to also add an 'OrganizationID' to the settings.
104
104
// Omitting the 'OrganizationID' could produce the incorrect value, as
105
105
// workspaces have both `user` and `organization` owners.
106
- Object UserPermissionCheckObject `json:"object"`
106
+ Object UserAuthorizationObject `json:"object"`
107
107
// Action can be 'create', 'read', 'update', or 'delete'
108
108
Action string `json:"action"`
109
109
}
110
110
111
- type UserPermissionCheckObject struct {
111
+ type UserAuthorizationObject struct {
112
112
// ResourceType is the name of the resource.
113
113
// './coderd/rbac/object.go' has the list of valid resource types.
114
114
ResourceType string `json:"resource_type"`
0 commit comments