seek icon indicating copy to clipboard operation
seek copied to clipboard

Gatekeeper can't see assets to approve

Open rabuono opened this issue 2 years ago • 11 comments

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 image

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise
  • Browser Chrome and Firefox
  • SEEK at testing instance: v.1.13.0-master

rabuono avatar Jul 20 '22 09:07 rabuono

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

floradanna avatar Jul 20 '22 09:07 floradanna

@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

image

fbacall avatar Jul 20 '22 12:07 fbacall

@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. image

But the approved Investigation only got partial sharing image

Also, I went back in and, in single page, created a Study and a Sample inside that Study. image

These don't show in /requested_approval_assets or /waiting_approval_assets image

rabuono avatar Jul 20 '22 13:07 rabuono

If I create a Study in default SEEK (not Single Page), it shows up in /requested_approval_assets

image

rabuono avatar Jul 20 '22 13:07 rabuono

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".

fbacall avatar Jul 20 '22 13:07 fbacall

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

rabuono avatar Jul 20 '22 13:07 rabuono

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: image

A screenshot of the modified sharing permissions for the Sample due to the gatekeeper feature: image

A screenshot of the created Sample not showing in the gatekeeper's list: image

rabuono avatar Jul 22 '22 13:07 rabuono

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

rabuono avatar Jul 22 '22 13:07 rabuono

I am trying to reproduce the issue on branch seek-1.12 , it seems no problem of showing assets which are waiting for approval. image

image

whomingbird avatar Sep 19 '22 10:09 whomingbird

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 avatar Sep 19 '22 11:09 whomingbird

@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.

rabuono avatar Sep 19 '22 11:09 rabuono

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.

fherreazcue avatar Jun 05 '23 11:06 fherreazcue