Repository navigation
Conversation
…rators The job endpoints under /api/v1/jobs and /api/v1/content/_import now answer for the user who created a job, or for a CMS Administrator: - Reading, cancelling and monitoring a job by id answer 404 for anyone else, the same as for an id that does not exist. - Job listings hold only the caller's own jobs for non-administrators, narrowed in SQL so paging and totals stay correct. - Job responses leave out the parameters the server sets for uploaded files (tempFileId, requestFingerPrint, and bulk upload's requestFingerprint and stagedFiles[].tempFileId); the processors still receive them. - The generic create endpoint answers 400 when a request supplies those parameters itself. JobQueueManagerAPI gains getJob, cancelJob and getJobs variants that take the requesting User. A new JobListView enum holds the job states of each listing, and the existing listing methods now delegate to the view-based one. The user-less methods stay for internal callers (maintenance, folder bulk delete). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An administrator can cancel another user's job. - A job created without a userId parameter is available to CMS Administrators only; canAccess now refuses it outright for everyone else instead of comparing against a missing value. - A userId parameter in a create request is replaced by the requesting user's id. - requestFingerprint (bulk upload's spelling) is rejected on create, like the other two spellings. - Re-indent the monitor endpoint's 500 response annotation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AP2300
requested review from
adrianjm-dotCMS,
danielsilva-dotcms,
fabrizzio-dotCMS,
hassandotcms,
hmoreras and
jcastro-dotcms
October 30, 2026 16:44
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The job endpoints (
/api/v1/jobs/**and/api/v1/content/_import/**) now answer for the user who created a job, or for a CMS Administrator. Job listings are narrowed to the caller's own jobs, and job responses no longer include the parameters the server sets for uploaded files.Changes
JobQueueManagerAPI): newgetJob(jobId, User),cancelJob(jobId, User)andgetJobs(JobListView, queueName, User, page, pageSize).userIdparameter. A CMS Administrator isuser.isAdmin(), not a portlet check.DoesNotExistException, 404), the same as an id that does not exist.PostgresJobQueue): an optional owner condition,parameters @> jsonb_build_object('userId', ?).job.parameters.JobListViewenum holds each listing's states, so the per-state methods now delegate to one view-based method. Their SQL and ordering are unchanged.JobQueueResource,ContentImportResourceandSSEMonitorUtilpass the requesting user. The helpers no longer offer user-less read, cancel or list methods.JobResponseUtil.forResponse): the following are left out of job parameters. The processors still receive them.tempFileIdandrequestFingerPrint.requestFingerprint, and thetempFileIdof eachstagedFilesentry.stagedFilesitself stays, with each file's name and size.POST /api/v1/jobs/{queueName}and/{queueName}/uploadanswer 400 when the request supplies any of those parameters. The server still sets them for an uploaded file.JobPaginatedResultrequirestotal,pageandpageSize, so the previous fallback threw.openapi.yamlregenerated.Tests
JobQueueHelperIntegrationTest:userIdin a create request is replaced by the requesting user's id;/api/v1/jobsendpoint and all 8 listings.relation "cms_role" does not exist.PostgresJobQueueIntegrationTest: owner-narrowed listings for everyJobListView, per queue and across queues, with paging and totals.ContentImportResourceIntegrationTest: another back-end user gets 404 on read and cancel, and does not see the job in any of the 7 listings; the monitor opens for the requesting user. The administrator reads the job without the staged-file parameters.JobQueueResourceAPITestsandContentImportResourceassertions now expecttempFileIdandrequestFingerPrintto be absent.FolderBulkDeleteCancellationIT. The new tests were confirmed failing before the change. A local image built from this branch was also checked endpoint by endpoint with a creator, another back-end user and an administrator.All test classes are already registered in
Junit5Suite1; no suite change.Risk
userIdparameter are available to CMS Administrators only. Every current producer sets it.Fixes dotCMS/private-issues#872
🤖 Generated with Claude Code