Skip to content

Commit

Permalink
Merge pull request #37 from 2lenet/fix_security
Browse files Browse the repository at this point in the history
fix: security with the correct class in widgets
  • Loading branch information
SpaghettiBolognaise authored Jan 11, 2023
2 parents 504545e + bf6599a commit fa7c97e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/Contracts/WidgetTypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public function getType();
*/
public function getName();

/**
* @return array json schema for config
*/
public function getJsonSchema();

/**
* @return string returns widget title
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
autowire: false
autoconfigure: false
calls:
- setSecurity: ['@security.authorization_checker']
- setSecurity: ['@Symfony\Component\Security\Core\Security']
- setTwig: ['@twig']
- setFormFactory: ['@form.factory']

Expand Down
10 changes: 2 additions & 8 deletions src/Widgets/AbstractWidget.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Lle\DashboardBundle\Form\Type\JsonType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Security;
use Twig\Environment;

Expand Down Expand Up @@ -51,7 +50,7 @@ abstract class AbstractWidget implements WidgetTypeInterface
/**
* @var Security
*/
protected AuthorizationCheckerInterface $security;
protected Security $security;

protected Environment $twig;

Expand Down Expand Up @@ -148,11 +147,6 @@ public function getTitle()
return $this->title;
}

public function getJsonSchema()
{
return null;
}

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -243,7 +237,7 @@ public function twig($template, array $context = []): string
/**
* @required
*/
public function setSecurity(AuthorizationCheckerInterface $security): self
public function setSecurity(Security $security): self
{
$this->security = $security;

Expand Down

0 comments on commit fa7c97e

Please sign in to comment.