Skip to content
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

when a user was deleted remove them from applicable list, unless... #17920

Merged
merged 2 commits into from
Dec 4, 2019

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Nov 12, 2019

it is the only user, then remove the mount

fixes #15258

@icewind1991 does it make sense to you?

  • Then, we need basically the same for groups.

@blizzz blizzz added this to the Nextcloud 18 milestone Nov 12, 2019
@blizzz blizzz changed the title when a user was delete remove them from applicable list, unless... when a user was deleted remove them from applicable list, unless... Nov 12, 2019
@blizzz
Copy link
Member Author

blizzz commented Nov 13, 2019

Ah, edge case. It will remove mounts who are made accessible for groups plus this user. No, works all as it should.

@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 13, 2019
@blizzz blizzz requested a review from nickvergessen November 13, 2019 13:29
it is the only user, then remove the mount

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz force-pushed the fix/15258/ext-storage-respect-deletion branch from 58da404 to 4baab51 Compare November 28, 2019 16:03
@blizzz
Copy link
Member Author

blizzz commented Nov 29, 2019

@nickvergessen @icewind1991 can we get this in?

@nickvergessen nickvergessen merged commit 254d4e0 into master Dec 4, 2019
@nickvergessen nickvergessen deleted the fix/15258/ext-storage-respect-deletion branch December 4, 2019 14:28
@blizzz
Copy link
Member Author

blizzz commented Dec 4, 2019

/backport to stable17

@blizzz
Copy link
Member Author

blizzz commented Dec 4, 2019

/backport to stable16

@blizzz
Copy link
Member Author

blizzz commented Dec 4, 2019

/backport to stable15

$builder = $this->connection->getQueryBuilder();
$query = $builder->select(['a.mount_id', $builder->func()->count('a.mount_id', 'count')])
->from('external_applicable', 'a')
->rightJoin('a', 'external_applicable', 'b', $builder->expr()->eq('a.mount_id', 'b.mount_id'))
Copy link
Member

Choose a reason for hiding this comment

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

Right join was not supported on sqlite iirc

Copy link
Member Author

Choose a reason for hiding this comment

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

turning it around seems to work, same table after all. PR incoming,

@juliusknorr
Copy link
Member

Breaks quite some integration tests: https://drone.nextcloud.com/nextcloud/server/23756/32/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External Storage - WebDAV - New user has access to storage from deleted user (same user-ID)
4 participants