Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Access/AccessResult.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 1fec387a4317 |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
334 $result = static::forbidden(); | 334 $result = static::forbidden(); |
335 if (!$this->isForbidden() || ($this->getCacheMaxAge() === 0 && $other->isForbidden())) { | 335 if (!$this->isForbidden() || ($this->getCacheMaxAge() === 0 && $other->isForbidden())) { |
336 $merge_other = TRUE; | 336 $merge_other = TRUE; |
337 } | 337 } |
338 | 338 |
339 if ($this->isForbidden() && $this instanceof AccessResultReasonInterface) { | 339 if ($this->isForbidden() && $this instanceof AccessResultReasonInterface && !is_null($this->getReason())) { |
340 $result->setReason($this->getReason()); | 340 $result->setReason($this->getReason()); |
341 } | 341 } |
342 elseif ($other->isForbidden() && $other instanceof AccessResultReasonInterface) { | 342 elseif ($other->isForbidden() && $other instanceof AccessResultReasonInterface && !is_null($other->getReason())) { |
343 $result->setReason($other->getReason()); | 343 $result->setReason($other->getReason()); |
344 } | 344 } |
345 } | 345 } |
346 elseif ($this->isAllowed() || $other->isAllowed()) { | 346 elseif ($this->isAllowed() || $other->isAllowed()) { |
347 $result = static::allowed(); | 347 $result = static::allowed(); |
351 } | 351 } |
352 else { | 352 else { |
353 $result = static::neutral(); | 353 $result = static::neutral(); |
354 if (!$this->isNeutral() || ($this->getCacheMaxAge() === 0 && $other->isNeutral()) || ($this->getCacheMaxAge() !== 0 && $other instanceof CacheableDependencyInterface && $other->getCacheMaxAge() !== 0)) { | 354 if (!$this->isNeutral() || ($this->getCacheMaxAge() === 0 && $other->isNeutral()) || ($this->getCacheMaxAge() !== 0 && $other instanceof CacheableDependencyInterface && $other->getCacheMaxAge() !== 0)) { |
355 $merge_other = TRUE; | 355 $merge_other = TRUE; |
356 if ($other instanceof AccessResultReasonInterface) { | 356 } |
357 $result->setReason($other->getReason()); | 357 |
358 } | 358 if ($this instanceof AccessResultReasonInterface && !is_null($this->getReason())) { |
359 } | 359 $result->setReason($this->getReason()); |
360 else { | 360 } |
361 if ($this instanceof AccessResultReasonInterface) { | 361 elseif ($other instanceof AccessResultReasonInterface && !is_null($other->getReason())) { |
362 $result->setReason($this->getReason()); | 362 $result->setReason($other->getReason()); |
363 } | |
364 } | 363 } |
365 } | 364 } |
366 $result->inheritCacheability($this); | 365 $result->inheritCacheability($this); |
367 if ($merge_other) { | 366 if ($merge_other) { |
368 $result->inheritCacheability($other); | 367 $result->inheritCacheability($other); |