mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Using SiteTree->getSiteConfig() instead of SiteConfig::current_site_config() in SiteTree::batch_permission_check() to avoid cases where multiple variances of SiteConfig need to be considered (e.g. when using the subsites module) (AIR-59)
This commit is contained in:
parent
1fcc987b78
commit
6ab1340680
@ -1123,14 +1123,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if($potentiallyInherited) {
|
||||
// Group $potentiallyInherited by ParentID; we'll look at the permission of all those
|
||||
// parents and then see which ones the user has permission on
|
||||
$siteConfigPermission = SiteConfig::current_site_config()->{$siteConfigMethod}($memberID);
|
||||
$groupedByParent = array();
|
||||
foreach($potentiallyInherited as $item) {
|
||||
if($item->ParentID) {
|
||||
if(!isset($groupedByParent[$item->ParentID])) $groupedByParent[$item->ParentID] = array();
|
||||
$groupedByParent[$item->ParentID][] = $item->ID;
|
||||
} else {
|
||||
$result[$item->ID] = $siteConfigPermission;
|
||||
// Might return different site config based on record context, e.g. when subsites module is used
|
||||
$siteConfig = $item->getSiteConfig();
|
||||
$result[$item->ID] = $siteConfig->{$siteConfigMethod}($memberID);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user