-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Deletion of user should also delete applicable users for the storage #32696
Conversation
For the record, [stable10] already merged: #32069 |
When a user is deleted the storage added by the user should be removed from the db. This change helps to remove the user from the applicable with the help of DBConfigService. Signed-off-by: Sujith H <sharidasan@owncloud.com>
22267c1
to
35bb075
Compare
The referenced PR is stable10 and as far as I have seen there is no corresponding master PR (even it would not work properly). |
@sharidas please double check if there are missing references |
Let me add my results here:
There is no reference of "user4" here. Another test to have 2 personal storages for user4:
Another test to have global storages for user4 and no personal storages:
The above tests do cover global storages only, personal storages only and both global + personal storages. Which in my humble opinion covers most of the cases. |
* Remove any mounts which are applicable to only this user | ||
* Specifically targeted to, mounts created by the user. | ||
*/ | ||
if (\count($userMount['applicable']) === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so are we removing the user from the applicable list in a different location in the code ? (when applicable is more than one user). from your test results it seems to work so properly different existing code ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GlobalStoragesService
does remove user from applicable list, here https://github.com/owncloud/core/blob/master/lib/private/Files/External/Service/GlobalStoragesService.php#L199-L214. So as per the test #32637 (comment) -> the global storages does remove user4
from the applicable list.
Let me know if this was the information, that you are looking for. If not I would need your helping hand in understanding the query.
The not working pr merged to master branch -> #30712 and stable10 branch pr -> #32069 ( not working ). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@sharidas please backport |
Backport PR: #32906 |
When a user is deleted the storage added by the user
should be removed from the db. This change helps to
remove the user from the applicable with the help
of DBConfigService.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
When a user is deleted, the storages created by user should be cleaned from the db. That is the applicable array should not have any more residues about the user.
Related Issue
Motivation and Context
When a user is deleted, the storages created by user should be cleaned from the db. That is the applicable array should not have any more residues about the user.
How Has This Been Tested?
Following the procedure from steps to produce in #32637 (comment):
user4
the tables were like this:user4
is deleted table is as shown below:user4
again and the table is as shown:user4
and the table is as shown below:sftpuser4
.Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: