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

Extend the API to get Dataset user permissions, new File user permissions, and deaccessioned support for getDatasetVersion endpoint #10023

Merged
merged 8 commits into from Oct 20, 2023

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Oct 18, 2023

What this PR does / why we need it:

These changes are required for the SPA.

  • New query parameter includeDeaccessioned added to the getVersion endpoint (/api/datasets/{id}/versions/{versionId}) to consider deaccessioned versions when searching for versions.

  • New endpoint to get user permissions on a dataset (/api/datasets/{id}/userPermissions). In particular, the user permissions that this API call checks, returned as booleans, are the following:

    • Can view the unpublished dataset
    • Can edit the dataset
    • Can publish the dataset
    • Can manage the dataset permissions
    • Can delete the dataset draft
  • New permission check "canManageFilePermissions" added to the existing endpoint for getting user permissions on a file (/api/access/datafile/{id}/userPermissions).

Which issue(s) this PR closes:

Closes #10001

Special notes for your reviewer:

None

Suggestions on how to test this:

Via curl, perform calls for different users (different API keys), and check that the retrieved permissions are correct.

For dataset user permissions:

curl -H "X-Dataverse-key: $API_TOKEN" -X GET "$SERVER_URL/api/datasets/$ID/userPermissions"
For file user permissions:

curl -H "X-Dataverse-key:$API_TOKEN" -X GET "$SERVER_URL/api/access/datafile/$ID/userPermissions"
Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No

Is there a release notes update needed for this change?:

Yes

Additional documentation:

None

@GPortas GPortas marked this pull request as ready for review October 18, 2023 10:49
@GPortas GPortas added this to Ready for Review ⏩ in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) via automation Oct 18, 2023
@GPortas GPortas added the SPA These changes are required for the Dataverse SPA label Oct 18, 2023
@github-actions

This comment has been minimized.

IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from In Review 🔎 to Ready for QA ⏩ Oct 18, 2023
@sekmiller sekmiller removed their assignment Oct 18, 2023
@kcondon kcondon self-assigned this Oct 18, 2023
@kcondon
Copy link
Contributor

kcondon commented Oct 18, 2023

@GPortas @donsizemore Also failing to build:
[ERROR] Failures:
[ERROR] SiteMapUtilTest.testUpdateSiteMap:107 Unexpected exception thrown: java.io.FileNotFoundException: /tmp/junit2219193089931826071/docroot/sitemap/sitemap.xml (No such file or directory)
[INFO]
[ERROR] Tests run: 1542, Failures: 1, Errors: 0, Skipped: 32
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.268 s
[INFO] Finished at: 2023-10-18T17:32:42-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test (default-test) on project dataverse: There are test failures.
[ERROR]
[ERROR] Please refer to /home/worker/workspace/IQSS_Dataverse_Internal/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Execute shell' marked build as failure
[PostBuildScript] - [INFO] Executing post build scripts.
[PostBuildScript] - [INFO] Build does not have any of the results [SUCCESS]. Did not execute build step #0.
[PostBuildScript] - [INFO] Build does not have any of the results [SUCCESS]. Did not execute build step #1.
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE

@github-actions
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10001-dataset-api-user-permissions
ghcr.io/gdcc/configbaker:10001-dataset-api-user-permissions

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@kcondon kcondon merged commit 0af5caf into develop Oct 20, 2023
17 of 18 checks passed
IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from Ready for QA ⏩ to Done 🚀 Oct 20, 2023
@kcondon kcondon deleted the 10001-dataset-api-user-permissions branch October 20, 2023 14:40
@pdurbin pdurbin added this to the 6.1 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SPA These changes are required for the Dataverse SPA
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Spike - API] Extend the API for obtaining the user permissions on a dataset
4 participants