src/EnvironmentChecker.php
public function canAccess($member = null, $permission = 'ADMIN')
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // We allow access to this controller regardless of live-status or ADMIN permission only
        // if on CLI.  Access to this controller is always allowed in "dev-mode", or of the user is ADMIN.
        if (Director::isDev()
            || Director::is_cli()
            || empty($permission)
            || Permission::checkMember($member, $permission)
        ) {
            return true;
        }

        // Extended access checks.
        // "Veto" style, return NULL to abstain vote.
        $canExtended = null;
        $results = $this->extend('canAccess', $member);
        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
            return true;
        }

        return false;
    }
public function canAccess($member = null, $permission = 'ADMIN')
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // We allow access to this controller regardless of live-status or ADMIN permission only
        // if on CLI.  Access to this controller is always allowed in "dev-mode", or of the user is ADMIN.
        if (Director::isDev()
            || Director::is_cli()
            || empty($permission)
            || Permission::checkMember($member, $permission)
        ) {
            return true;
        }

        // Extended access checks.
        // "Veto" style, return NULL to abstain vote.
        $canExtended = null;
        $results = $this->extend('canAccess', $member);
        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
            return true;
        }

        return false;
    }
public function canAccess ( $ member = null , $ permission = 'ADMIN' ) { if ( ! $ member ) { $ member = Security :: getCurrentUser ( ) ; } // We allow access to this controller regardless of live-status or ADMIN permission only // if on CLI.  Access to this controller is always allowed in "dev-mode", or of the user is ADMIN. if ( Director :: isDev ( ) || Director :: is_cli ( ) || empty ( $ permission ) || Permission :: checkMember ( $ member , $ permission ) ) { return true ; } // Extended access checks. // "Veto" style, return NULL to abstain vote. $ canExtended = null ; $ results = $ this -> extend ( 'canAccess' , $ member ) ; if ( $ results && is_array ( $ results ) ) { if ( ! min ( $ results ) ) { return false ; } return true ; } return false ; }
Determine if the current member can access the environment checker

@param null|int|Member $member
@param string          $permission
@return bool
Determine if the current member can access the environment checker