can anyone please help here, when I run this code, the editors for this are not able to see the sitetree. All that comes up is "There has been an error".
The error that comes up is: "[Error] Uncaught Exception: Object->__call(): the method 'organisation' does not exist on 'Page'"
This is coming from the line marked with stars:
public function canEdit($member = null) {
$return = false;
// If parent::canEdit() returns true, then the user is an admin so they're allowed to edit. We don't need to do
// any further checking.
// If parent::canEdit() returns false, then we want to continue checking whether the Member is part of the group
// of editors that this ResourcePage is associated with
$return = parent::canEdit($member);
if(!$return) {
// Get the Member object ($member could be instanceof Member, or ID, or null)
if(is_numeric($member)) $member = Member::get()->byID($member);
else $member = Member::currentUser();
if($member && $member->isInDB()) {
// Check whether this Member is in the organisation editing group
*** if($this->Parent && $this->Parent->Organisation() && $this->Parent->Organisation()->Group()) {
if($member->inGroup($this->Parent->Organisation()->Group(), true)) {
$return = true;
}
}
}
}
return $return;
}
any assistance in this matter would be greatly appreciated!