mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: Fixed SiteTreeSubsites::canEdit() so that it doesn't mess with other modules so much.
This commit is contained in:
parent
ae27dc25ff
commit
cd1433529b
@ -116,11 +116,13 @@ class SiteTreeSubsites extends DataObjectDecorator {
|
||||
* @return boolean
|
||||
*/
|
||||
function canEdit($member = null) {
|
||||
if(!$member) $member = Member::currentUser();
|
||||
|
||||
// Check the CMS_ACCESS_CMSMain privileges on the subsite that owns this group
|
||||
$oldSubsiteID = Session::get('SubsiteID');
|
||||
|
||||
Subsite::changeSubsite($this->owner->SubsiteID) ;
|
||||
$access = Permission::check('CMS_ACCESS_CMSMain');
|
||||
$access = Permission::checkMember($member, 'CMS_ACCESS_CMSMain');
|
||||
Subsite::changeSubsite($oldSubsiteID);
|
||||
|
||||
if(!$access) $access = Permission::checkMember($member, 'SUBSITE_ACCESS_ALL');
|
||||
|
Loading…
Reference in New Issue
Block a user