Skip to content

Show pending shares menu only if feature enabled #53455

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

printminion-co
Copy link
Contributor

@printminion-co printminion-co commented Jun 12, 2025

Summary

Currently the "pending shares" is always available if feature enabled or not

Documentation: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html

Selection_20250612-003

Proposal

With this change the "pending shares" will be displayed only if feature is enabled.

"pending shares" menu item is shown on

./occ config:system:set --value true --type boolean -- sharing.enable_share_accept

"pending shares" menu item is removed on

./occ config:system:set --value false --type boolean -- sharing.enable_share_accept

run test via

 phpunit --bootstrap tests/bootstrap.php apps/files_sharing/tests/Listener/LoadAdditionalListenerTest.php

TODO

  • ...

Checklist

@printminion-co printminion-co marked this pull request as ready for review June 12, 2025 14:42
@printminion-co printminion-co requested review from a team as code owners June 12, 2025 14:42
@printminion-co printminion-co requested review from artonge, skjnldsv, szaimen and come-nc and removed request for a team June 12, 2025 14:42
@szaimen szaimen removed their request for review June 12, 2025 14:44
@AndyScherzinger AndyScherzinger added the 3. to review Waiting for reviews label Jun 12, 2025
@AndyScherzinger AndyScherzinger requested a review from sorbaugh June 12, 2025 15:31
Comment on lines +40 to +44
private function provideInitialStates(): void {
$initialState = Server::get(InitialStateService::class);
$config = Server::get(IConfig::class);
$defaultAcceptSystemConfig = $config->getSystemValueBool('sharing.enable_share_accept');
$initialState->provideInitialState(Application::APP_ID, 'accept_default', $defaultAcceptSystemConfig);
Copy link
Contributor

Choose a reason for hiding this comment

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

As documented in config sample, this can be overridden by any user:

/**
 * Set to true to enable that internal shares need to be accepted by the users by default.
 * Users can change this for their account in their personal sharing settings
 */
'sharing.enable_share_accept' => false,

Also, users may have pending shares from before the option was set, I suppose?
I also fear that internal share are not the only kind and that users still need to accept pending federated shares even if the option is set, at least that’s how I understand the comment in config sample.

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.

Could we instead check if there are any pending shares, and hide the menu if there are none?

Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

# menu is removed on
./occ config:system:set --value true --type boolean  -- sharing.enable_share_accept

# menu is shown on
./occ config:system:set --value false --type boolean  -- sharing.enable_share_accept

Signed-off-by: Misha M.-Kupriyanov <[email protected]>
@printminion-co printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch from b5b8444 to a8b8100 Compare July 3, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants