MCPcopy Index your code
hub / github.com/coder/coder / Authorize

Method Authorize

coderd/authorize.go:56–58  ·  view source on GitHub ↗

Authorize will return false if the user is not authorized to do the action. This function will log appropriately, but the caller must return an error to the api client. Eg: if !api.Authorize(...) { httpapi.Forbidden(rw) return }

(r *http.Request, action policy.Action, object rbac.Objecter)

Source from the content-addressed store, hash-verified

54// return
55// }
56func (api *API) Authorize(r *http.Request, action policy.Action, object rbac.Objecter) bool {
57 return api.HTTPAuth.Authorize(r, action, object)
58}
59
60// Authorize will return false if the user is not authorized to do the action.
61// This function will log appropriately, but the caller must return an

Callers 15

provisionerDaemonsMethod · 0.95
NewFunction · 0.95
putUserProfileMethod · 0.95
putUserPasswordMethod · 0.95
userRolesMethod · 0.95
templateExamplesMethod · 0.95
postTestNotificationMethod · 0.95
postWorkspaceUsageMethod · 0.95
patchWorkspaceACLMethod · 0.95

Calls 1

AuthorizeMethod · 0.65

Tested by

no test coverage detected