Skip to content

Conversation

@juliusknorr
Copy link
Member

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

@juliusknorr juliusknorr added bug 3. to review Waiting for reviews labels May 16, 2024
@juliusknorr juliusknorr 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
@juliusknorr juliusknorr added this to the Nextcloud 27.1.10 milestone May 16, 2024
@juliusknorr juliusknorr requested review from a team, Pytal, artonge, nfebe, sorbaugh and szaimen 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

@juliusknorr juliusknorr May 16, 2024

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.

@juliusknorr
Copy link
Member Author

/compile

Copy link
Contributor

@nfebe nfebe 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?

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

nfebe
nfebe previously requested changes May 16, 2024
Copy link
Contributor

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

@juliusknorr
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
@Pytal Pytal force-pushed the fix/stable27-download-action branch from bba6363 to 3c7a526 Compare May 22, 2024 18:11
@Pytal Pytal dismissed nfebe’s stale review May 22, 2024 18:13

Resolved

@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 <[email protected]>
@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
@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.

6 participants