Skip to content

Conversation

@g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Feb 19, 2025

What this PR does / why we need it:

Adds the Restrict File use case. It can restrict or unrestrict a file.

Which issue(s) this PR closes:

Suggestions on how to test this:

Review code and tests.

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. GREI Re-arch GREI re-architecture-related Original size: 3 SPA.Q1.6 Files Page: Files Edit Options FY25 Sprint 17 FY25 Sprint 17 (2025-02-12 - 2025-02-26) labels Feb 20, 2025
@g-saracca g-saracca changed the title Feat/259 restrict unrestrict file use case Restrict File use case Feb 20, 2025
@ekraffmiller ekraffmiller self-assigned this Feb 21, 2025
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple of questions

* @param {boolean} [restrict] - A boolean value that indicates whether the file should be restricted or unrestricted.
* @returns {Promise<void>} -This method does not return anything upon successful completion.
*/
async execute(fileId: number | string, restrict: boolean): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the UI, the restrict file modal includes an option of changing the default fileAccessRequest value, and adding termsOfAccessForRestrictedFiles. (these values are also in the Terms tab). Do we want to add this as optional params to the restrict method? Or from the frontend, should it be handled by making a separate API call to update Dataset Terms of Use?

Screenshot 2025-02-21 at 1 31 37 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, the API is not accepting params and I think it's ok.
A second API call to update Dataset Terms of Use seems reasonable.
We can do that separately while working on the frontend integration. Is there a use case for doing that in Js-dataverse?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, we don't have a use case for updating terms of use yet, so yes would be good to work on that separately.

@g-saracca
Copy link
Contributor Author

@ekraffmiller ready for review again.

@g-saracca g-saracca removed their assignment Feb 24, 2025
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, approved!

@ofahimIQSS
Copy link
Contributor

tests are passing - merging pr

@ofahimIQSS ofahimIQSS merged commit e689f25 into develop Feb 24, 2025
5 checks passed
@ofahimIQSS ofahimIQSS deleted the feat/259-restrict-unrestrict-file-use-case branch February 24, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 17 FY25 Sprint 17 (2025-02-12 - 2025-02-26) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q1.6 Files Page: Files Edit Options

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Implement use case for restricting or unrestricting a single file

4 participants