DNProject::canCreateEnvironments PHP Méthode

canCreateEnvironments() public méthode

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
Résultat 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;
    }