Service Accounts: Don't show error pop-ups for Service Account and Renderer UI flows (#101776)
* don't show error pop-ups for SAs and renderer * only hide non 4xx error pop'ups * linting
This commit is contained in:
+2
-2
@@ -505,7 +505,7 @@ func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *contextmodel.ReqContex
|
||||
|
||||
if !c.SignedInUser.IsIdentityType(claims.TypeUser) {
|
||||
hs.log.Debug("Requested endpoint only available to users")
|
||||
c.JsonApiErr(http.StatusForbidden, "Endpoint only available for users", nil)
|
||||
c.JsonApiErr(http.StatusNotModified, "Endpoint only available for users", nil)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ func (hs *HTTPServer) ClearHelpFlags(c *contextmodel.ReqContext) response.Respon
|
||||
func (hs *HTTPServer) getUserID(c *contextmodel.ReqContext) (int64, *response.NormalResponse) {
|
||||
if !c.SignedInUser.IsIdentityType(claims.TypeUser) {
|
||||
hs.log.Debug("Requested endpoint only available to users")
|
||||
return 0, response.Error(http.StatusForbidden, "Endpoint only available for users", nil)
|
||||
return 0, response.Error(http.StatusNotModified, "Endpoint only available for users", nil)
|
||||
}
|
||||
|
||||
userID, err := c.SignedInUser.GetInternalID()
|
||||
|
||||
Reference in New Issue
Block a user