mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: Fix subsites permissions not paying attention to roles (from r87163) (from r96278)
This commit is contained in:
parent
cf765abed8
commit
9536ae6f01
@ -538,6 +538,27 @@ JS;
|
||||
>>>>>>> .merge-right.r88146
|
||||
);
|
||||
|
||||
$rolesSubsites = DataObject::get(
|
||||
'Subsite',
|
||||
"`Group_Members`.`MemberID` = $member->ID
|
||||
AND `PermissionRoleCode`.`Code` IN ($SQL_codes, 'ADMIN')
|
||||
AND `Subsite`.Title != ''",
|
||||
'',
|
||||
"LEFT JOIN `Group` ON (`SubsiteID`=`Subsite`.`ID` OR `SubsiteID` = 0)
|
||||
LEFT JOIN `Group_Members` ON `Group_Members`.`GroupID`=`Group`.`ID`
|
||||
LEFT JOIN `Group_Roles` ON `Group_Roles`.`GroupID`=`Group`.`ID`
|
||||
LEFT JOIN `PermissionRole` ON `Group_Roles`.`PermissionRoleID`=`PermissionRole`.`ID`
|
||||
LEFT JOIN `PermissionRoleCode` ON `PermissionRole`.`ID`=`PermissionRoleCode`.`RoleID`"
|
||||
);
|
||||
|
||||
if(!$subsites && $rolesSubsites) return $rolesSubsites;
|
||||
|
||||
if($rolesSubsites) foreach($rolesSubsites as $subsite) {
|
||||
if(!$subsites->containsIDs(array($subsite->ID))) {
|
||||
$subsites->push($subsite);
|
||||
}
|
||||
}
|
||||
|
||||
$rolesSubsites = DataObject::get(
|
||||
'Subsite',
|
||||
"{$q}Subsite{$q}.Title != ''",
|
||||
|
Loading…
Reference in New Issue
Block a user