seek
seek copied to clipboard
Gatekeeper can't see assets to approve
Describe the bug Assets waiting for approval of a gatekeeper do not show for approval.
To Reproduce Steps to reproduce the behavior: User1 is the gatekeeper of the Project. User2 creates an asset (an Investigation), sets it to be public, and gets warned that the gatekeeper needs to approve it before the Investigation is set to public. Meanwhile, Investigation is kept at high privacy (visible only to Project members, but not managed by anyone other than User2). User1 can't see any assets to be approved, while User2 sees the asset waiting to be approved.
Expected behavior
Assets waiting for approval are displayed on the waiting_approval_assets
page, and can be approved.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10 Enterprise
- Browser Chrome and Firefox
- SEEK at testing instance: v.1.13.0-master
Related to this, in DataHub test instance the following behaviour happens:
Bob (project admin) can click to make his Investigation Public even if Alice is the Gatekeeper of the project, without any warning message. However, the Investigation remains private without any warning message and Alice doesn't receive any notification about this. See screencast below.
https://user-images.githubusercontent.com/51486716/179945023-c10ffec9-ba08-4566-bce0-9ecc28153ad4.mov
@rabuono the screenshot you posted for User1 is for the "Assets awaiting approval" page, which shows assets that user has submitted for gatekeeper approval. Requests for publishing would show up on the "Assets you are Gatekeeping" page
@fbacall You are correct. Sorry. Silly mistake.
I went back in and clicked the correct button and go to approve the Investigation.
However, the Project has a full sharing default policy.
But the approved Investigation only got partial sharing
Also, I went back in and, in single page, created a Study and a Sample inside that Study.
These don't show in /requested_approval_assets
or /waiting_approval_assets
If I create a Study in default SEEK (not Single Page), it shows up in /requested_approval_assets
Gatekeeper approval only affects the "Public" access level. In this case it also has "Download" permissions, but it does not show because its an Investigation.
A bug/feature here seems to be that when a new asset is waiting to be approved, it gets given a generic "projects" policy (Projects can view/download, private to everyone else), rather than what the user requested (probably the project's default policy in this case): https://github.com/seek4science/seek/blob/1766ea842daac4f9c212a5101f47d849e4cd7df1/lib/seek/permissions/publishing_permissions.rb#L123-L132
It should probably be changed to set the policy to what the user requested, except with the "Public" permission set to "No access".
A bug/feature here seems to be that when a new asset is waiting to be approved, it gets given a generic "projects" policy (Projects can view/download, private to everyone else), rather than what the user requested (probably the project's default policy in this case):
Indeed. Giving it what was requested by the Project Admin makes more sense and is the expected behavior. Can we get the more expected behavior of respecting the default sharing policy of the Project upon approval by the gatekeeper?
But also, Assets made through Single Page don't seem to be showing at /requested_approval_assets
It seems that Samples, created through SEEK's default Sample creation, also do not show up in the gatekeeper's list for approval.
A screenshot showing the gatekeeper warning message, and underneath the original Sample sharing permission of all public:
A screenshot of the modified sharing permissions for the Sample due to the gatekeeper feature:
A screenshot of the created Sample not showing in the gatekeeper's list:
So maybe best is to:
- [ ] Set Gatekeeper to only affect the permissions related to the
Public
- [ ] Set the assets created trough Single Page to also show up in the Gatekeeper list, when a gatekeeper is assigned and a non-gatekeeper tries to set an asset as public by hand or by a Project default sharing policy
- [ ] Make Samples also appear in the Gatekeeper
requested_approval_assets
list when when a gatekeeper is assigned and a non-gatekeeper tries to set a Sample as public by hand or by a Project default sharing policy
I am trying to reproduce the issue on branch seek-1.12
, it seems no problem of showing assets which are waiting for approval.
When i read all the following comments, i realised that the issue is different from what described at the top... It is more than a bug.
@whomingbird Thanks for checking! It does end up in the three items mentioned at the earlier comment.
Samples seem to be problematic regardless of when being created through Single Page or Default view.
The main issue with samples was addressed here. The single page issue seems to have originated from the same problem, PublishingCommon was not imported for samples, and it seems to be fixed with the same commit.