Skip to content

Make the share accept process optional - #18940

Merged
rullzer merged 3 commits into
masterfrom
force-share-accept
Jan 17, 2020
Merged

Make the share accept process optional#18940
rullzer merged 3 commits into
masterfrom
force-share-accept

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

This PR makes accepting shares automatically the default. There are two config.php settings:

  • sharing.enable_share_accept - set to true to disable automated share acceptance (reverting the current logic in master)
  • sharing.force_share_accept - allow to enforce the new mechanism

The sharing settings will be hidden if accepting is enforced.

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable18

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also I think you need to update the classmap


private function handleAutoAccept(IShare $share, string $userId) {
if ($this->config->getUserValue($userId, 'files_sharing','default_accept','no') === 'yes') {
$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't we have another if here. That if share accept is false. We just accept it directly?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

No this is just the default value that might be overwritten later by the user value. If no user value is set it will be used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aaaah right!

Signed-off-by: Julius Härtl <jus@bitgrid.net>
…are acceptance process
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@rullzer
rullzer merged commit d1c8469 into masterJan 17, 2020
@rullzer
rullzer deleted the force-share-accept branch January 17, 2020 00:14
@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable18 failed. Please do this backport manually.

@juliusknorrjuliusknorr added the pending documentation This pull request needs an associated documentation update label Mar 25, 2020
@juliusknorrjuliusknorr removed the pending documentation This pull request needs an associated documentation update label Nov 14, 2022
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

Autodocumented through the config.php sample

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@juliusknorr@rullzer@skjnldsv