@@ -76,23 +76,23 @@ type UserRoles struct {
7676 OrganizationRoles map [uuid.UUID ][]string `json:"organization_roles"`
7777}
7878
79- type UserPermissionCheckResponse map [string ]bool
79+ type UserAuthorizationResponse map [string ]bool
8080
81- // UserPermissionCheckRequest is a structure instead of a map because
81+ // UserAuthorizationRequest is a structure instead of a map because
8282// go-playground/validate can only validate structs. If you attempt to pass
8383// a map into 'httpapi.Read', you will get an invalid type error.
84- type UserPermissionCheckRequest struct {
84+ type UserAuthorizationRequest struct {
8585 // Checks is a map keyed with an arbitrary string to a permission check.
8686 // The key can be any string that is helpful to the caller, and allows
8787 // multiple permission checks to be run in a single request.
8888 // The key ensures that each permission check has the same key in the
8989 // response.
90- Checks map [string ]UserPermissionCheck `json:"checks"`
90+ Checks map [string ]UserAuthorization `json:"checks"`
9191}
9292
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
9494// to a given set of objects.
95- type UserPermissionCheck struct {
95+ type UserAuthorization struct {
9696 // Object can represent a "set" of objects, such as:
9797 // - All workspaces in an organization
9898 // - All workspaces owned by me
@@ -103,12 +103,12 @@ type UserPermissionCheck struct {
103103 // owned by 'me', try to also add an 'OrganizationID' to the settings.
104104 // Omitting the 'OrganizationID' could produce the incorrect value, as
105105 // workspaces have both `user` and `organization` owners.
106- Object UserPermissionCheckObject `json:"object"`
106+ Object UserAuthorizationObject `json:"object"`
107107 // Action can be 'create', 'read', 'update', or 'delete'
108108 Action string `json:"action"`
109109}
110110
111- type UserPermissionCheckObject struct {
111+ type UserAuthorizationObject struct {
112112 // ResourceType is the name of the resource.
113113 // './coderd/rbac/object.go' has the list of valid resource types.
114114 ResourceType string `json:"resource_type"`
0 commit comments