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

[stable27] fix: Keep download action for files and hide only for relevant files #45344

Merged
merged 3 commits into from
May 23, 2024

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented May 16, 2024

Deleting the file actions if permissions do not apply causes them to generally disappear as the list of file actions to show is built once the user clicks the action menu, not when the file list row is rendered.

This PR will adapt the already existing shouldShow callback that is used for inline actions to regular ones so that we can check at time of displaying the menu with the context of the current file and hide it accordingly.

@juliushaertl juliushaertl added bug 3. to review Waiting for reviews labels May 16, 2024
@juliushaertl juliushaertl changed the title fix: Keep download action for files and hide only for relevant files [stable27] fix: Keep download action for files and hide only for relevant files May 16, 2024
@juliushaertl juliushaertl added this to the Nextcloud 27.1.10 milestone May 16, 2024
@juliushaertl juliushaertl requested review from a team, Pytal, szaimen, sorbaugh, artonge and Fenn-CS and removed request for a team and sorbaugh May 16, 2024 08:29
Comment on lines -91 to -93
delete fileActions.actions.all.Comment
delete fileActions.actions.all.Details
delete fileActions.actions.all.Goto
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems already done with the permissions checks on the individual actions

@szaimen szaimen removed their request for review May 16, 2024 08:33
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

The change make sense, but I am wondering whether the issue was always there or if it was introduced by a recent change.

@juliushaertl
Copy link
Member Author

/compile

Copy link
Contributor

@Fenn-CS Fenn-CS left a comment

Choose a reason for hiding this comment

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

Changes look okay.

Two questions:

  • How to reproduce this bug?
  • Only nc27 affected?

@juliushaertl
Copy link
Member Author

How to reproduce this bug?

Sorry should have mentioned that in the description:

  1. User A: Create a share without download permissions to User B
  2. User B: See the incoming share in the file list
  3. User B: Try to download another file through the file actions menu

Only nc27 affected?

Yes, seems fine with 28+ due to the files2vue migration.

Copy link
Contributor

@Fenn-CS Fenn-CS left a comment

Choose a reason for hiding this comment

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

Sorry, this needs a little adjustment, so this works correctly on the main file listing page but then on the "Shares" tab the "Download" option still appears. Granted the user cannot download the file but it should not appear at all there.

@juliushaertl
Copy link
Member Author

Sorry, this needs a little adjustment, so this works correctly on the main file listing page but then on the "Shares" tab the "Download" option still appears. Granted the user cannot download the file but it should not appear at all there.

I tried but wasn't able to come up with a proper fix for this before going on vacation. It seems we're lacking to expose the share attributes that are used to check if the button should be hidden when constructing the objects for the shared file listing.

@artonge Maybe @Fenn-CS or someone else from the files team can take over this one to get into the second RC?

@skjnldsv skjnldsv mentioned this pull request May 22, 2024
10 tasks
juliushaertl and others added 2 commits May 22, 2024 11:10
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the fix/stable27-download-action branch from bba6363 to 3c7a526 Compare May 22, 2024 18:11
@Pytal Pytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 22, 2024
Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the fix/stable27-download-action branch from 3c7a526 to b6988c7 Compare May 22, 2024 18:18
@AndyScherzinger AndyScherzinger merged commit b127e02 into stable27 May 23, 2024
37 of 39 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/stable27-download-action branch May 23, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants