Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Sep 29, 2023
1 parent 51ece6a commit 4864767
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion databox/api/src/Controller/Core/MoveCollectionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public function __invoke(Collection $data, string $dest, Request $request): Coll
$this->denyAccessUnlessGranted(AbstractVoter::EDIT, $data);

$isRoot = 'root' === $dest;
$this->denyAccessUnlessGranted(AbstractVoter::EDIT, $data);

if ($isRoot) {
$destination = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,23 @@ public function hydrateDocument(PostTransformEvent $event): void

$document = $event->getDocument();

$bestPrivacy = $collection->getBestPrivacyInParentHierarchy();

if ($bestPrivacy < WorkspaceItemPrivacyInterface::PUBLIC) {
$bestPrivacy = max($bestPrivacy, $collection->getBestPrivacyInDescendantHierarchy());
}
$bestPrivacy = $collection->getBestPrivacyInDescendantHierarchy();

[$users, $groups] = $this->discoverChildren($collection);

if (!in_array(null, $users, true)) {
$parent = $collection->getParent();
while (null !== $parent) {
$users = array_merge($users, $this->permissionManager->getAllowedUsers($parent, PermissionInterface::VIEW));
if (in_array(null, $users, true)) {
break;
}

$groups = array_merge($groups, $this->permissionManager->getAllowedGroups($parent, PermissionInterface::VIEW));
$parent = $parent->getParent();
}
}
// TODO check impact
// if (!in_array(null, $users, true)) {
// $parent = $collection->getParent();
// while (null !== $parent) {
// $users = array_merge($users, $this->permissionManager->getAllowedUsers($parent, PermissionInterface::VIEW));
// if (in_array(null, $users, true)) {
// break;
// }
//
// $groups = array_merge($groups, $this->permissionManager->getAllowedGroups($parent, PermissionInterface::VIEW));
// $parent = $parent->getParent();
// }
// }

if (in_array(null, $users, true)) {
$users = ['*'];
Expand Down
1 change: 0 additions & 1 deletion uploader/client/src/uploadBatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export default class UploadBatch {
formData: this.formData,
target: `/targets/${this.targetId}`,
};
const accessToken = oauthClient.getAccessToken();

authenticatedRequest({
url: '/commit',
Expand Down

0 comments on commit 4864767

Please sign in to comment.