Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #48 from spiral-modules/add-context-to-allowed-tag
Browse files Browse the repository at this point in the history
Update allowed.dark.php
  • Loading branch information
vvval committed Apr 2, 2018
2 parents 374769d + 6b167bc commit d466736
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/views/elements/allowed.dark.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php #compile
$this->runtimeVariable('permission', '${permission}');
$this->runtimeVariable('arguments', '${arguments}');
?><?php
/**
* @var string $permission
* @var \Spiral\Security\GuardInterface $guard
*/
$guard = spiral(\Spiral\Security\GuardInterface::class);
if ($guard->allows($permission)) {
if ($guard->allows($permission, $arguments ?: [])) {
ob_start(); ?>${context}<?php
echo ob_get_clean();
}
?>
?>

0 comments on commit d466736

Please sign in to comment.