DNProject::canCreateEnvironments PHP Method

canCreateEnvironments() public method

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
return 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;
    }