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
|
* @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');
|
||||||
|
Loading…
Reference in New Issue
Block a user