Skip to content

Hide shares by disabled users - #39699

Merged
come-nc merged 3 commits into
masterfrom
enh/hide-shares-from-disabled-users
Aug 28, 2023
Merged

Hide shares by disabled users#39699
come-nc merged 3 commits into
masterfrom
enh/hide-shares-from-disabled-users

Conversation

@come-nc

@come-nccome-nc commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

Summary

  1. Use occ config:app:set files_sharing hide_disabled_user_shares --value yes to enable
  2. Once enabled shares by disabled user will appear as non-existing
  3. Shares of files owned by disabled users will disappear as well, even if shared by someone else
  4. Compatible with advanced option from user_ldap to disable users missing from LDAP

Checklist

@come-nccome-nc added enhancement 3. to review Waiting for reviews pending documentation This pull request needs an associated documentation update labels Aug 3, 2023
@come-nccome-nc added this to the Nextcloud 28 milestone Aug 3, 2023
@come-nccome-nc self-assigned this Aug 3, 2023
@come-nccome-nc changed the title Set files_sharing:hide_disabled_user_shares to 'yes' to hide shares from disabled usersHide shares by disabled usersAug 3, 2023
@come-nc
come-ncforce-pushed the enh/hide-shares-from-disabled-users branch 2 times, most recently from 6baadbe to ee34b90CompareAugust 7, 2023 15:09
@come-nc
come-nc requested review from a team, Altahrim, ArtificialOwl, artonge, icewind1991, nfebe and susnux and removed request for a teamAugust 7, 2023 15:10
Comment threadlib/private/Share20/Manager.php
Comment threadlib/private/Share20/Manager.php Outdated

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

My comment is not a blocker and will probably be addressed in another PR

public function testGetShareByToken() {
$this->config
->expects($this->once())
->expects($this->exactly(2))

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.

I prefer just removing these counts altogether as they don't actually contribute to the test.

@icewind1991

Copy link
Copy Markdown
Member

What is the reasoning for not doing this by default?

@AndyScherzinger

Copy link
Copy Markdown
Member

@come-nc I think having it in 27.1 would be nice to have some (more) upgrade motivation for the requesting party, no?

@come-nc

Copy link
Copy Markdown
ContributorAuthor

What is the reasoning for not doing this by default?

Avoid a behavior change on update which will not please everyone.
Most people want to disable users to prevent them from logging and do not want to lose access to their shared data.

@come-nc

Copy link
Copy Markdown
ContributorAuthor

@come-nc I think having it in 27.1 would be nice to have some (more) upgrade motivation for the requesting party, no?

Not my call, if you think it fits and 27.1 is still open we can backport.

come-ncand others added 3 commits August 28, 2023 09:40
…rom disabled users
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
@come-nc
come-ncforce-pushed the enh/hide-shares-from-disabled-users branch from 943cc1c to 24ad2e2CompareAugust 28, 2023 07:40
@AndyScherzinger

Copy link
Copy Markdown
Member

27.1 is still open we can backport.

yes, still open and fine to backport 👍

@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable27

@come-nc
come-nc merged commit ac3d7e3 into masterAug 28, 2023
@come-nc
come-nc deleted the enh/hide-shares-from-disabled-users branch August 28, 2023 13:33
@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable23

@backportbot-nextcloud

Copy link
Copy Markdown

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

# Switch to the target branch and update it
git checkout stable23
git pull origin stable23
# Create the new backport branch
git checkout -b fix/foo-stable23
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable23

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable26

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

Labels

3. to reviewWaiting for reviewsenhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable shares for deactivated users

6 participants

@come-nc@icewind1991@AndyScherzinger@nickvergessen@susnux@Altahrim