-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix permissions of mountpoints #4623
Conversation
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @nickvergessen and @tanghus to be potential reviewers. |
Does this fix nextcloud/groupfolders#7? Any more information would be appreciated. Thanks. |
if ($mount instanceof MoveableMount) { | ||
$data['permissions'] = $data['permissions'] | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE; | ||
} else { | ||
$data['permissions'] = $data['permissions'] & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE)); |
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.
Please do proper bitwise stuff.
So
$data['permissions'] & ~(\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE);
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.
This was copied from getFolderContents
I can change both
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.
Ah well leave as is for now then.
Yes, but it still shows rename/move as option in the ui, will have to look into that issue seperate |
Reverted in #4684 @icewind1991 Please have a loot at this. |
@LukasReschke FYI regarding release stuff. |
:-/ |
Properly prevent people from moving/renaming mountpoints