mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: include a link and more useful error details for 403 response codes (#16644)
Currently if a user gets to a page they don't have permission to view they're greeted with a vague error alert and no actionable items. This PR adds a link back to _/workspaces_ within the alert as well as more helpful error details. Before:  After: 
This commit is contained in:
@ -154,6 +154,7 @@ func ResourceNotFound(rw http.ResponseWriter) {
|
||||
func Forbidden(rw http.ResponseWriter) {
|
||||
Write(context.Background(), rw, http.StatusForbidden, codersdk.Response{
|
||||
Message: "Forbidden.",
|
||||
Detail: "You don't have permission to view this content. If you believe this is a mistake, please contact your administrator or try signing in with different credentials.",
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user