mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-04 07:08:34 +02:00
BUGFIX: Use live permissions if the stage page has been deleted. (from r91761)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96741 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
26244b743d
commit
0ce4714fdf
@ -972,7 +972,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$combinedStageResult = array();
|
$combinedStageResult = array();
|
||||||
|
|
||||||
foreach(array('Stage', 'Live') as $stage) {
|
foreach(array('Stage', 'Live') as $stage) {
|
||||||
$result = array_fill_keys($ids, false);
|
// Start by filling the array with the pages that actually exist
|
||||||
|
$table = ($stage=='Stage') ? "SiteTree" : "SiteTree_$stage";
|
||||||
|
$result = DB::query("SELECT \"ID\",0 FROM \"$table\"
|
||||||
|
WHERE \"ID\" IN (".implode(", ", $ids).")")->map();
|
||||||
|
|
||||||
// Get the uninherited permissions
|
// Get the uninherited permissions
|
||||||
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"CanEditType\" = 'LoggedInUsers' OR
|
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"CanEditType\" = 'LoggedInUsers' OR
|
||||||
@ -1013,6 +1016,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
}
|
}
|
||||||
|
|
||||||
$combinedStageResult = $combinedStageResult + $result;
|
$combinedStageResult = $combinedStageResult + $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user