share submission not working correctly
This is what the user sees. She's the 3rd one to edit the submission. The first share between non admin submitter an admin works ok. The second share from the admin to another non admin behaves like this.
My guess is that the feature just switches the submitter but leaves the resource policy untouched.
This is the status of the authorizations when the admin took possession of the item; Eva is the original submitter.
My thinking is that it works for admins (because admin status) but any other non admin user would need resource policy. To test this I've added the same policies (which was a bit pain because of https://github.com/DSpace/DSpace/issues/10632) as Eva has also to Zdenka - and that seems to have fixed it.
another issue - when I'm not logged in, the &workspaceitemid=342 get's lost in one of the redirects, and thus "take it" doesn't work.
In more detail:
- I copy paste: https://lindat.mff.cuni.cz/repository//share-submission/change-submitter?share_token=XXX&workspaceitemid=342
- I'm redirect to /login
- I get back to the change submitter page but workspaceitemid is not in url
@milanmajchrak
There's still an issue with this - discovered when creating new versions (which for some reason duplicates the bitstreams and bundles - both ORIGINAL and LICENSE), so I'm guessing this must be the same when we share a submission with some bitstreams.
- Admin created a new version of an item
- admin used the share functionality
- the user couldn't remove the old file neither could he add a different one
From the logs:
2025-09-19 12:24:59,217 ERROR 21311714-bead-4e4c-825a-78e668337abd d97ba999-5db2-4baa-8a3b-e27421d043ba org.dspace.app.rest.submit.SubmissionService @ Authorization denied for action REMOVE on BUNDLE:1a68e830-1908-4d36-a4cb-8a7ec21b8f02 by user b02700ec-de15-4c51-ba19-ef14aa84b829
org.dspace.authorize.AuthorizeException: Authorization denied for action REMOVE on BUNDLE:1a68e830-1908-4d36-a4cb-8a7ec21b8f02 by user b02700ec-de15-4c51-ba19-ef14aa84b829
at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:173) ~[dspace-api-7.6.1.jar:7.6.1]
at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:121) ~[dspace-api-7.6.1.jar:7.6.1]
at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:115) ~[dspace-api-7.6.1.jar:7.6.1]
at org.dspace.content.BundleServiceImpl.removeBitstream(BundleServiceImpl.java:230) ~[dspace-api-7.6.1.jar:7.6.1]
at org.dspace.app.rest.submit.factory.impl.BitstreamRemovePatchOperation.remove(BitstreamRemovePatchOperation.java:64) ~[classes/:7.6.1]
at org.dspace.app.rest.submit.factory.impl.RemovePatchOperation.perform(RemovePatchOperation.java:27) ~[classes/:7.6.1]
at org.dspace.app.rest.submit.step.UploadStep.doPatchProcessing(UploadStep.java:98) ~[classes/:7.6.1]
at org.dspace.app.rest.submit.SubmissionService.evaluatePatchToInprogressSubmission(SubmissionService.java:451) [classes/:7.6.1]
at org.dspace.app.rest.repository.WorkspaceItemRestRepository.patch(WorkspaceItemRestRepository.java:259) [classes/:7.6.1]
at org.dspace.app.rest.repository.WorkspaceItemRestRepository.patch(WorkspaceItemRestRepository.java:100) [classes/:7.6.1]
at org.dspace.app.rest.repository.WorkspaceItemRestRepository$$FastClassBySpringCGLIB$$987ae76d.invoke(<generated>) [classes/:7.6.1]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.3.27.jar:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) [spring-aop-5.3.27.jar:5.3.27]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.3.27.jar:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) [spring-aop-5.3.27.jar:5.3.27]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61) [spring-security-core-5.7.8.jar:5.7.8]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.3.27.jar:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) [spring-aop-5.3.27.jar:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) [spring-aop-5.3.27.jar:5.3.27] at org.dspace.app.rest.repository.WorkspaceItemRestRepository$$EnhancerBySpringCGLIB$$649537ad.patch(<generated>) [classes/:7.6.1]
at org.dspace.app.rest.repository.DSpaceRestRepository.patch(DSpaceRestRepository.java:448) [classes/:7.6.1] at org.dspace.app.rest.repository.DSpaceRestRepository$$FastClassBySpringCGLIB$$615525f9.invoke(<generated>) [classes/:7.6.1]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.3.27.jar:5.3.27]
and from the resourcepolicy table (this is just for bundles, I have removed the bitstreams without checking their resource policies).
select * from resourcepolicy where dspace_object in (select bundle_id from item2bundle where item_id = 'b8d0662a-3731-4b3d-9ffb-ceddb001d49f');
policy_id | resource_type_id | resource_id | action_id | start_date | end_date | rpname | rptype | rpdescription | eperson_id | epersongroup_id | dspace_object
-----------+------------------+-------------+-----------+------------+----------+--------+-----------------+---------------+--------------------------------------+-----------------+--------------------------------------
209445 | 1 | | 0 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 1a68e830-1908-4d36-a4cb-8a7ec21b8f02
209446 | 1 | | 1 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 1a68e830-1908-4d36-a4cb-8a7ec21b8f02
209447 | 1 | | 3 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 1a68e830-1908-4d36-a4cb-8a7ec21b8f02
209448 | 1 | | 4 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 1a68e830-1908-4d36-a4cb-8a7ec21b8f02
209449 | 1 | | 2 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 1a68e830-1908-4d36-a4cb-8a7ec21b8f02
209455 | 1 | | 0 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 432afbc4-1cbc-4a06-9bec-2bddfde8a657
209456 | 1 | | 1 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 432afbc4-1cbc-4a06-9bec-2bddfde8a657
209457 | 1 | | 3 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 432afbc4-1cbc-4a06-9bec-2bddfde8a657
209458 | 1 | | 4 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 432afbc4-1cbc-4a06-9bec-2bddfde8a657
209459 | 1 | | 2 | | | | TYPE_SUBMISSION | | ADMIN-UUID | | 432afbc4-1cbc-4a06-9bec-2bddfde8a657
(10 rows)