DNProject::canCreateEnvironments PHP 메소드

canCreateEnvironments() 공개 메소드

Only admins can create environments for now. Also, we need to check the value of AllowedEnvironmentType which dictates which backend to use to render the form.
public canCreateEnvironments ( Member | null $member = null ) : boolean
$member Member | null
리턴 boolean
    public function canCreateEnvironments($member = null)
    {
        $envType = $this->AllowedEnvironmentType;
        if ($envType) {
            $env = Injector::inst()->get($envType);
            if ($env instanceof EnvironmentCreateBackend) {
                return $this->allowed(DNRoot::ALLOW_CREATE_ENVIRONMENT, $member);
            }
        }
        return false;
    }