Skip to content

Show pending shares menu only if feature enabled - #53455

Open
printminion-co wants to merge 3 commits into
nextcloud:masterfrom
IONOS-Productivity:feat/hide_pending_shares_menu_if_disabled
Open

Show pending shares menu only if feature enabled#53455
printminion-co wants to merge 3 commits into
nextcloud:masterfrom
IONOS-Productivity:feat/hide_pending_shares_menu_if_disabled

Conversation

@printminion-co

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

Copy link
Copy Markdown
Contributor

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, come-nc, skjnldsv and szaimen 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
Copy Markdown
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.

@artonge artonge left a comment

Copy link
Copy Markdown
Collaborator

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?

@github-actions

Copy link
Copy Markdown
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.)

@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch 2 times, most recently from a8b8100 to 4a2893c Compare July 7, 2025 13:44
@susnux susnux added the community pull requests from community label Jun 9, 2026
@pringelmann pringelmann added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 11, 2026
@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch from 4a2893c to 8315a49 Compare July 17, 2026 14:05
@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch from f0b1c16 to fb20a98 Compare July 17, 2026 15:46
@printminion-co
printminion-co requested a review from a team as a code owner July 17, 2026 15:46
@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch 2 times, most recently from 36848b1 to 7cbb3fa Compare July 17, 2026 16:14
Comment thread apps/files_sharing/lib/Listener/LoadAdditionalListener.php Outdated
Comment thread apps/files_sharing/lib/Listener/LoadAdditionalListener.php Outdated
@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch from 7cbb3fa to 9cd18f3 Compare July 24, 2026 09:22
Resolve the share manager through constructor injection instead of
Server::get() so the listener follows the app's dependency-injection
conventions.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
# 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 <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
@printminion-co
printminion-co force-pushed the feat/hide_pending_shares_menu_if_disabled branch from 9cd18f3 to a366b5f Compare July 24, 2026 10:14
@printminion-co
printminion-co requested a review from artonge July 24, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress community pull requests from community feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants