mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Access control: Using RBAC to filter users in list view that you have read access to (#47963)
* Add SQL filter for global user search * Remove scope requirements from endpoints Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> Co-authored-by: Ieva <ieva.vasiljeva@grafana.com> Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
@@ -61,7 +61,14 @@ func (s *OSSService) SearchUser(c *models.ReqContext) (*models.SearchUsersQuery,
|
||||
}
|
||||
}
|
||||
|
||||
query := &models.SearchUsersQuery{Query: searchQuery, Filters: filters, Page: page, Limit: perPage}
|
||||
query := &models.SearchUsersQuery{
|
||||
// added SignedInUser to the query, as to only list the users that the user has permission to read
|
||||
SignedInUser: c.SignedInUser,
|
||||
Query: searchQuery,
|
||||
Filters: filters,
|
||||
Page: page,
|
||||
Limit: perPage,
|
||||
}
|
||||
if err := s.sqlStore.SearchUsers(c.Req.Context(), query); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user