backports murph-skeleton
This commit is contained in:
parent
c6a7d40a4f
commit
ee2f82e93a
|
@ -32,6 +32,7 @@ abstract class AdminController extends AbstractController
|
||||||
$parameters['section'] = $this->getSection();
|
$parameters['section'] = $this->getSection();
|
||||||
$parameters['site_name'] = $this->coreParameters['site']['name'];
|
$parameters['site_name'] = $this->coreParameters['site']['name'];
|
||||||
$parameters['site_logo'] = $this->coreParameters['site']['logo'];
|
$parameters['site_logo'] = $this->coreParameters['site']['logo'];
|
||||||
|
$parameters['murph_version'] = defined('MURPH_VERSION') ? MURPH_VERSION : null;
|
||||||
|
|
||||||
return parent::render($view, $parameters, $response);
|
return parent::render($view, $parameters, $response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,22 +44,20 @@ class RequestSecurityEventSubscriber implements EventSubscriberInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$operator = $node->getSecurityOperator();
|
$operator = $node->getSecurityOperator();
|
||||||
$exception = new AccessDeniedException('Access denied');
|
$exception = new AccessDeniedException('Access denied.');
|
||||||
$isAuthorized = false;
|
|
||||||
|
|
||||||
foreach ($roles as $role) {
|
foreach ($roles as $role) {
|
||||||
$isGranted = $this->authorizationChecker->isGranted($role);
|
$isGranted = $this->authorizationChecker->isGranted($role);
|
||||||
|
|
||||||
if ('or' === $operator && $isGranted) {
|
if ('or' === $operator && $isGranted) {
|
||||||
$isAuthorized = true;
|
return;
|
||||||
} elseif ('and' === $operator && !$isGranted) {
|
}
|
||||||
|
if ('and' === $operator && !$isGranted) {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isAuthorized) {
|
throw $exception;
|
||||||
throw $exception;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
|
|
|
@ -546,3 +546,13 @@ form {
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#murph-version {
|
||||||
|
display: inline;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 2px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
|
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
{{ include('@Core/admin/module/account.html.twig') }}
|
{{ include('@Core/admin/module/account.html.twig') }}
|
||||||
|
|
||||||
|
{% if murph_version %}
|
||||||
|
<div id="murph-version">
|
||||||
|
<a href="https://doc.murph-project.org/" target="_blank">{{ murph_version }}</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ require dirname(__DIR__).'/vendor/autoload.php';
|
||||||
|
|
||||||
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
|
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
|
||||||
|
|
||||||
|
define('MURPH_VERSION', 'v1.8.0');
|
||||||
|
|
||||||
if ($_SERVER['APP_DEBUG']) {
|
if ($_SERVER['APP_DEBUG']) {
|
||||||
umask(0000);
|
umask(0000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue