Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Double check whether the Area overrides the collection permission #1874

Merged
merged 1 commit into from Jan 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions web/concrete/core/models/permission/assignments/block.php
Expand Up @@ -35,6 +35,15 @@ public function setPermissionObject(Block $b) {
if (is_object($a)) {
if ($a->overrideCollectionPermissions()) {
$this->permissionObjectToCheck = $a;
} elseif ($a->getAreaCollectionInheritID()) {
$mcID = $a->getAreaCollectionInheritID();
$mc = Page::getByID($mcID, 'RECENT');
$ma = Area::get($mc, $a->getAreaHandle());
if ($ma->overrideCollectionPermissions()) {
$this->permissionObjectToCheck = $ma;
} else {
$this->permissionObjectToCheck = $ma->getAreaCollectionObject();
}
} else {
$this->permissionObjectToCheck = $a->getAreaCollectionObject();
}
Expand Down