BUGFIX: Fixed SiteTreeSubsites::canEdit() so that it doesn't mess with other modules so much.

This commit is contained in:
Sam Minnee 2009-05-15 03:12:43 +00:00
parent ae27dc25ff
commit cd1433529b

View File

@ -116,11 +116,13 @@ class SiteTreeSubsites extends DataObjectDecorator {
* @return boolean * @return boolean
*/ */
function canEdit($member = null) { function canEdit($member = null) {
if(!$member) $member = Member::currentUser();
// Check the CMS_ACCESS_CMSMain privileges on the subsite that owns this group // Check the CMS_ACCESS_CMSMain privileges on the subsite that owns this group
$oldSubsiteID = Session::get('SubsiteID'); $oldSubsiteID = Session::get('SubsiteID');
Subsite::changeSubsite($this->owner->SubsiteID) ; Subsite::changeSubsite($this->owner->SubsiteID) ;
$access = Permission::check('CMS_ACCESS_CMSMain'); $access = Permission::checkMember($member, 'CMS_ACCESS_CMSMain');
Subsite::changeSubsite($oldSubsiteID); Subsite::changeSubsite($oldSubsiteID);
if(!$access) $access = Permission::checkMember($member, 'SUBSITE_ACCESS_ALL'); if(!$access) $access = Permission::checkMember($member, 'SUBSITE_ACCESS_ALL');