feat: Add permissions for links (#1407)

This commit is contained in:
Bruno Quaresma
2022-05-13 14:25:57 +00:00
committed by GitHub
parent 64a8b4ac47
commit e6168ba238
16 changed files with 192 additions and 47 deletions
+2 -2
View File
@@ -40,12 +40,12 @@ func (api *api) checkPermissions(rw http.ResponseWriter, r *http.Request) {
return
}
var params codersdk.UserPermissionCheckRequest
var params codersdk.UserAuthorizationRequest
if !httpapi.Read(rw, r, &params) {
return
}
response := make(codersdk.UserPermissionCheckResponse)
response := make(codersdk.UserAuthorizationResponse)
for k, v := range params.Checks {
if v.Object.ResourceType == "" {
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{