CI: Bump golangci-lint to 2.0.2 (#103572)
This commit is contained in:
+11
-11
@@ -38,7 +38,7 @@ func (hs *HTTPServer) AddOrgUserToCurrentOrg(c *contextmodel.ReqContext) respons
|
||||
if err := web.Bind(c.Req, &cmd); err != nil {
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
cmd.OrgID = c.SignedInUser.GetOrgID()
|
||||
cmd.OrgID = c.GetOrgID()
|
||||
return hs.addOrgUserHelper(c, cmd)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func (hs *HTTPServer) addOrgUserHelper(c *contextmodel.ReqContext, cmd org.AddOr
|
||||
if !cmd.Role.IsValid() {
|
||||
return response.Error(http.StatusBadRequest, "Invalid role specified", nil)
|
||||
}
|
||||
if !c.SignedInUser.GetOrgRole().Includes(cmd.Role) && !c.SignedInUser.GetIsGrafanaAdmin() {
|
||||
if !c.SignedInUser.GetOrgRole().Includes(cmd.Role) && !c.GetIsGrafanaAdmin() {
|
||||
return response.Error(http.StatusForbidden, "Cannot assign a role higher than user's role", nil)
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ func (hs *HTTPServer) addOrgUserHelper(c *contextmodel.ReqContext, cmd org.AddOr
|
||||
// 500: internalServerError
|
||||
func (hs *HTTPServer) GetOrgUsersForCurrentOrg(c *contextmodel.ReqContext) response.Response {
|
||||
result, err := hs.searchOrgUsersHelper(c, &org.SearchOrgUsersQuery{
|
||||
OrgID: c.SignedInUser.GetOrgID(),
|
||||
OrgID: c.GetOrgID(),
|
||||
Query: c.Query("query"),
|
||||
Limit: c.QueryInt("limit"),
|
||||
User: c.SignedInUser,
|
||||
@@ -146,7 +146,7 @@ func (hs *HTTPServer) GetOrgUsersForCurrentOrg(c *contextmodel.ReqContext) respo
|
||||
|
||||
func (hs *HTTPServer) GetOrgUsersForCurrentOrgLookup(c *contextmodel.ReqContext) response.Response {
|
||||
orgUsersResult, err := hs.searchOrgUsersHelper(c, &org.SearchOrgUsersQuery{
|
||||
OrgID: c.SignedInUser.GetOrgID(),
|
||||
OrgID: c.GetOrgID(),
|
||||
Query: c.Query("query"),
|
||||
Limit: c.QueryInt("limit"),
|
||||
User: c.SignedInUser,
|
||||
@@ -277,7 +277,7 @@ func (hs *HTTPServer) SearchOrgUsersWithPaging(c *contextmodel.ReqContext) respo
|
||||
}
|
||||
|
||||
query := &org.SearchOrgUsersQuery{
|
||||
OrgID: c.SignedInUser.GetOrgID(),
|
||||
OrgID: c.GetOrgID(),
|
||||
Query: c.Query("query"),
|
||||
Page: page,
|
||||
Limit: perPage,
|
||||
@@ -325,9 +325,9 @@ func (hs *HTTPServer) searchOrgUsersHelper(c *contextmodel.ReqContext, query *or
|
||||
// Get accesscontrol metadata and IPD labels for users in the target org
|
||||
accessControlMetadata := map[string]accesscontrol.Metadata{}
|
||||
if c.QueryBool("accesscontrol") {
|
||||
permissions := c.SignedInUser.GetPermissions()
|
||||
if query.OrgID != c.SignedInUser.GetOrgID() {
|
||||
identity, err := hs.authnService.ResolveIdentity(c.Req.Context(), query.OrgID, c.SignedInUser.GetID())
|
||||
permissions := c.GetPermissions()
|
||||
if query.OrgID != c.GetOrgID() {
|
||||
identity, err := hs.authnService.ResolveIdentity(c.Req.Context(), query.OrgID, c.GetID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -368,7 +368,7 @@ func (hs *HTTPServer) UpdateOrgUserForCurrentOrg(c *contextmodel.ReqContext) res
|
||||
if err := web.Bind(c.Req, &cmd); err != nil {
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
cmd.OrgID = c.SignedInUser.GetOrgID()
|
||||
cmd.OrgID = c.GetOrgID()
|
||||
var err error
|
||||
cmd.UserID, err = strconv.ParseInt(web.Params(c.Req)[":userId"], 10, 64)
|
||||
if err != nil {
|
||||
@@ -411,7 +411,7 @@ func (hs *HTTPServer) updateOrgUserHelper(c *contextmodel.ReqContext, cmd org.Up
|
||||
if !cmd.Role.IsValid() {
|
||||
return response.Error(http.StatusBadRequest, "Invalid role specified", nil)
|
||||
}
|
||||
if !c.SignedInUser.GetOrgRole().Includes(cmd.Role) && !c.SignedInUser.GetIsGrafanaAdmin() {
|
||||
if !c.SignedInUser.GetOrgRole().Includes(cmd.Role) && !c.GetIsGrafanaAdmin() {
|
||||
return response.Error(http.StatusForbidden, "Cannot assign a role higher than user's role", nil)
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ func (hs *HTTPServer) RemoveOrgUserForCurrentOrg(c *contextmodel.ReqContext) res
|
||||
|
||||
return hs.removeOrgUserHelper(c.Req.Context(), &org.RemoveOrgUserCommand{
|
||||
UserID: userId,
|
||||
OrgID: c.SignedInUser.GetOrgID(),
|
||||
OrgID: c.GetOrgID(),
|
||||
ShouldDeleteOrphanedUser: true,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user