Skip to content

Commit

Permalink
isGranted Bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
cesurapp committed May 9, 2020
1 parent a29362c commit b433d0d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Widget/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,18 @@ public function getWidgets($checkRole = true): ?array
public function addWidget(ItemInterface $item): WidgetInterface
{
// Check Security
if ($this->checkRole && $item->getRole() && !$this->security->isGranted($item->getRole())) {
return $this;
if ($this->checkRole && $item->getRole()) {
$decide = true;
foreach ($item->getRole() as $role) {
if (!$this->security->isGranted($item->getRole())) {
$decide = false;
break;
}
}

if ($decide) {
return $this;
}
}

// Add
Expand Down

0 comments on commit b433d0d

Please sign in to comment.