protected function allowCreate($dir, $name)
{
$path = $this->_joinPath($dir, $name);
$perm = null;
if ($this->access) {
if (is_array($this->access)) {
$obj = $this->access[0];
$method = $this->access[1];
$perm = $obj->{$method}('write', $path, $this->options['accessControlData'], $this);
} else {
$func = $this->access;
$perm = $func('write', $path, $this->options['accessControlData'], $this);
}
if ($perm !== null) {
return !!$perm;
}
}
$testPath = $this->separator . $this->_relpath($path);
for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
$attrs = $this->attributes[$i];
if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
$perm = $attrs['write'];
}
}
return $perm === null ? true : $perm;
}