Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set a data object private by the share button #2009

Closed
taojing2002 opened this issue Apr 23, 2022 · 6 comments
Closed

Can't set a data object private by the share button #2009

taojing2002 opened this issue Apr 23, 2022 · 6 comments
Assignees
Labels
Milestone

Comments

@taojing2002
Copy link

Describe the bug
I tried to use the Share button in the metadata editor to make a data object private in a package. However, the data object is public readable after the package was created.

To Reproduce
Steps to reproduce the behavior:

  1. On the metadata editor page
  2. Click on the "Share" button associated with the data object
  3. A pop up window shows the access options
  4. Toggle the private button (The attached screenshot shows the screen before I clicked the save button.)
  5. Click the Save button on the access options page
  6. Click the Save button on the metadata editor page

Expected behavior
The data object should be private. However, the metadata shows it is public readable.

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: Chrome
  • Version: MetacatUI 2.18.0
    Screen Shot 2022-04-22 at 10 45 04 PM
@taojing2002
Copy link
Author

It turns out the knb theme works but the default theme doesn't.

@amoeba amoeba added this to the 2.21.0 milestone Aug 5, 2022
@amoeba
Copy link
Contributor

amoeba commented Aug 5, 2022

I can't reproduce on develop with either the default or arctic themes so far. I'm going to coordinate with @taojing2002 via Slack to try to find a reproduction.

@robyngit
Copy link
Member

robyngit commented Aug 5, 2022

Thanks @amoeba!

@amoeba
Copy link
Contributor

amoeba commented Aug 5, 2022

I was able to reproduce it and can partly explain why this works on the knb theme and not the default. Here's a more specific set of steps to reproduce:

(Using the default theme, tip of develop)

  1. Navigate to the editor
  2. Attach a file
  3. Open the Share dialog for the file
  4. Click Save in the Share dialog
  5. Look at the Network pane and notice the sysmeta still contains public-read when the editor fetches the sysmeta after the updateSysMeta call

Why this works on the knb theme and not the default theme has to do with whatever the actual bug here is: If, when you toggle the file from public to private, the public-read rule was the last rule in the AccessPolicy, the rule appears to get removed from the AccessPolicy collection but the change isn't reflected when the sysmeta is updated. When the public-read rule is not the last rule (as is the case for the KNB because we always add the knb-data-admins group), the sysmeta does get updated.

The fix is probably a small change but I don't have time to figure it out at the moment. @robyngit can I kick this back over to you to look into in the future?

@robyngit
Copy link
Member

robyngit commented Aug 8, 2022

Thanks for the summary and for figuring out how to reproduce it, @amoeba! I'll look into it further.

@robyngit robyngit self-assigned this Aug 8, 2022
@robyngit robyngit removed this from the 2.21.0 milestone Aug 23, 2022
robyngit added a commit that referenced this issue Aug 23, 2022
- Ensure the accessPolicy node is removed from the system metadata xml when the access policy collection is empty

Fixes #2009
@robyngit robyngit added this to the 2.23.0 milestone Aug 23, 2022
@robyngit
Copy link
Member

This behaviour stemmed from a problem in the serialization of the system metadata. The old <accessPolicy> node was not being updated or removed when the new access policy was empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants