Folders: Fix folder pagination for cloud instances with many folders (#90008)
* filter the k6 folder out in the SQL queries rather than during post processing to ensure that the correct number of results is always returned * linting
This commit is contained in:
@@ -180,17 +180,7 @@ func (s *Service) GetFolders(ctx context.Context, q folder.GetFoldersQuery) ([]*
|
||||
}
|
||||
}
|
||||
|
||||
// only list k6 folders when requested by a service account - prevents showing k6 folders in the UI for users
|
||||
result := make([]*folder.Folder, 0, len(dashFolders))
|
||||
requesterIsSvcAccount := qry.SignedInUser.GetID().Namespace() == identity.NamespaceServiceAccount
|
||||
for _, folder := range dashFolders {
|
||||
if (folder.UID == accesscontrol.K6FolderUID || folder.ParentUID == accesscontrol.K6FolderUID) && !requesterIsSvcAccount {
|
||||
continue
|
||||
}
|
||||
result = append(result, folder)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return dashFolders, nil
|
||||
}
|
||||
|
||||
func (s *Service) Get(ctx context.Context, q *folder.GetFolderQuery) (*folder.Folder, error) {
|
||||
|
||||
Reference in New Issue
Block a user