Checks if the comment can be edited.

@param null|int|Member $member
@return Boolean
358805
public function canEdit($member = null)
    {
        $member = $this->getMember($member);

        if (!$member) {
            return false;
        }

        $extended = $this->extendedCan('canEdit', $member);
        if ($extended !== null) {
            return $extended;
        }

        if (Permission::checkMember($member, 'CMS_ACCESS_CommentAdmin')) {
            return true;
        }

        if ($parent = $this->Parent()) {
            return $parent->canEdit($member);
        }

        return false;
    }
820401
function isEditable() {
        if($this->managed) {
            return false;
        }
        
        $member = $this->guild->me;
        if(!$member->permissions->has(\CharlotteDunois\Yasmin\Models\Permissions::PERMISSIONS['MANAGE_ROLES'])) {
            return false;
        }
        
        return ($member->getHighestRole()->comparePositionTo($this) > 0);
    }
711060
public function canView($member = null)
    {
        $extended = $this->extendedCan(__FUNCTION__, $member);

        if ($extended !== null) {
            return $extended;
        }

        return $this->Blog()->canView($member);
    }
1359463
public function canView($member = null) {
		if(!$member) $member = Member::currentUser();

		if(Permission::checkMember($member, 'ADMIN')) return true;

		return $member->inGroups($this->Viewers());
	}
1045027
public function canCreate($member = null)
    {
        if (!$member) {
            $member = Member::currentUser();
        }

        $extended = $this->extendedCan('canCreate', $member);
        if ($extended !== null) {
            return $extended;
        }

        if ($member) {
            return true;
        } else {
            return false;
        }
    }
897639
public function canCreate($member = null, $context = array())
    {
        return $this->Action()->WorkflowDef()->canCreate($member, $context);
    }
1210447
public function canView($member = null)
    {
        if (parent::canView($member)) {
            return true;
        }

        if (Subsite::all_accessible_sites()->count() > 0) {
            return true;
        }

        return false;
    }
833688
public function canView($member = null)
    {
        $extended = $this->extendedCan(__FUNCTION__, $member);

        if ($extended !== null) {
            return $extended;
        }

        if ($this->Parent()) {
            return $this->Parent()->canView($member);
        }

        return parent::canView($member);
    }
860840
public function canView($member = null)
    {
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
            $member = Member::currentUser();
        }

        if ($member &&
            Permission::checkMember(
                $member,
                array(
                    'CMS_ACCESS_DMSDocumentAdmin',
                )
            )
        ) {
            return true;
        }
        return parent::canView($member);
    }
1316641
protected function isMemberOf($member, $relation)
    {
        if (!$member || !$member->exists()) {
            return false;
        }

        if ($relation instanceof UnsavedRelationList) {
            return in_array($member->ID, $relation->getIDList());
        }

        return $relation->byID($member->ID) !== null;
    }
1249701
public function isEditor($member)
    {
        $isEditor = $this->isMemberOf($member, $this->Editors());
        $this->extend('updateIsEditor', $isEditor, $member);

        return $isEditor;
    }
39371
public function canCreate($member = null, $context = [])
    {
        // Allow Only Root Level:
        
        if (isset($context['Parent'])) {
            return false;
        }
        
        // Answer Permission Check:
        
        return Permission::checkMember($member, ['ADMIN', 'SILVERWARE_FOLDER_CREATE']);
    }
84218
public function canDelete($member=null) {
        $parentResult=parent::canDelete($member);
        
        if($parentResult==false || $this->UserLanguage==false) {
            return false;
        }
        
        if($this->Folders()->count()>0 || $this->Snippets()->count()>0) {
            return false;
        }
        
        return true;
    }
261393
public function canView($member = null)
    {
        $parent = $this->Parent();
        if ($parent && $parent->exists()) {
            return $parent->canView($member);
        }

        return true;
    }
1035344
public function canEdit($member)
    {
        if (!Permission::check('EDIT_EMBARGOED_WORKFLOW') && // not given global/override permission to edit
            !$this->owner->AllowEmbargoedEditing) { // item flagged as not editable
            $publishTime = $this->owner->dbObject('PublishOnDate');

            if ($publishTime && $publishTime->InFuture() || // when scheduled publish date is in the future
                // when there isn't a publish date, but a Job is in place (publish immediately, but queued jobs is
                // waiting)
                (!$publishTime && $this->owner->PublishJobID != 0)
            ) {
                return false;
            }
        }
    }
1006050
public function can_edit_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool {
        global $CFG;

        $context = $this->get_context();
        $ownpost = $post->is_owned_by_user($user);
        $ineditingtime = $post->get_age() < $CFG->maxeditingtime;

        switch ($this->forum->get_type()) {
            case 'news':
                // Allow editing of news posts once the discussion has started.
                $ineditingtime = !$post->has_parent() && $discussion->has_started();
                break;
            case 'single':
                return $discussion->is_first_post($post) && has_capability('moodle/course:manageactivities', $context, $user);
        }

        return ($ownpost && $ineditingtime) || has_capability('mod/forum:editanypost', $context, $user);
    }
1151391
public function canEdit($member = null)
    {
        $managedSites = Multisites::inst()->sitesManagedByMember();
        if (count($managedSites) && in_array($this->owner->SiteID, $managedSites)) {
            // member has permission to manage MultisitesAware objects on this site,
            // hand over to the object's canEdit method
            return null;
        } else {
            // member does not have permission to edit objects on this object's Site
            return false;
        }
    }