-
Notifications
You must be signed in to change notification settings - Fork 0
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
enh: db schema change #79
Conversation
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
@@ -77,6 +80,7 @@ public function register(IRegistrationContext $context): void { | |||
$context->registerEventListener(NodeRemovedFromCache::class, FileListener::class); | |||
$context->registerEventListener(NodeWrittenEvent::class, FileListener::class); | |||
$context->registerEventListener(AppDisableEvent::class, AppDisableListener::class); | |||
$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); |
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.
Perhaps we also need Group member added/removed?
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.
Good point
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.
how about adding it later with complete group based ACLs. We won't need to translate group -> users then, only the list of groups the user is part of, on the fly when querying.
In the backend it would be checked if a file can be accessed by the user or one of the groups the user is part of.
We can maintain a local list in the backend for user-group mappings but fetching it on the fly is not expensive, so we won't even need the listener if a user was added/removed from a group.
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.
mmh. I'd stick with user-based ACLs for this iteration, I think.
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
$qb = $this->db->getQueryBuilder(); | ||
$qb->delete($this->getTableName()) | ||
->where($qb->expr()->eq('id', $qb->createPositionalParameter($file->getId()))) | ||
->where($qb->expr()->in('id', $qb->createPositionalParameter($fileIds, IQueryBuilder::PARAM_INT_ARRAY))) |
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.
Sweet!
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.
Woop woop
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
Signed-off-by: Anupam Kumar <[email protected]>
|
||
// the user(s) who have access to the file through file mounts, excluding the user(s) | ||
// who have really lost access to the file and are present in $fileUserIds list | ||
$realFileUserIds = array_diff($fileUserIds, $reallyUnsharedWith); |
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.
Scenario:
- File A is in a groupfolder
- File A is shared with group B additionally
- File A is unshared with group B but remains in groupfolder
- Will user in group B lose access?
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.
It is assumed that groupfolders and other non-share mounts do not also have a share.
Either case we'll be allowing more or less than actual access due to mount cache.
$this->logger->error('Could not open file ' . $file->getPath() . ' for reading', ['exception' => $e]); | ||
continue; | ||
} catch (LockedException $e) { | ||
$retryQFiles[] = $queueFile; | ||
$this->logger->info('File ' . $file->getPath() . ' is locked, could not read for indexing. Adding it to the next batch.'); |
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.
Smart!
I'm sorry for the big PR :(