Show pending shares menu only if feature enabled - #53455
Conversation
| 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); |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Could we instead check if there are any pending shares, and hide the menu if there are none?
|
Hello there, 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.) |
a8b8100 to
4a2893c
Compare
4a2893c to
8315a49
Compare
f0b1c16 to
fb20a98
Compare
36848b1 to
7cbb3fa
Compare
7cbb3fa to
9cd18f3
Compare
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>
9cd18f3 to
a366b5f
Compare
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
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
TODO
Checklist