BUGFIX: Fix subsites permissions not paying attention to roles (from r87163) (from r96278)

This commit is contained in:
Tom Rix 2010-03-01 21:57:05 +00:00
parent cf765abed8
commit 9536ae6f01

View File

@ -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 != ''",