NoopSecurityHandler.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of the Sonata project.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Security\Handler;
  11. use Sonata\AdminBundle\Admin\AdminInterface;
  12. class NoopSecurityHandler implements SecurityHandlerInterface
  13. {
  14. /**
  15. * {@inheritDoc}
  16. */
  17. public function isGranted(AdminInterface $admin, $attributes, $object = null)
  18. {
  19. return true;
  20. }
  21. /**
  22. * {@inheritDoc}
  23. */
  24. public function getBaseRole(AdminInterface $admin)
  25. {
  26. return '';
  27. }
  28. /**
  29. * {@inheritDoc}
  30. */
  31. public function buildSecurityInformation(AdminInterface $admin)
  32. {
  33. return array();
  34. }
  35. /**
  36. * {@inheritDoc}
  37. */
  38. public function createObjectSecurity(AdminInterface $admin, $object)
  39. {
  40. }
  41. /**
  42. * {@inheritDoc}
  43. */
  44. public function deleteObjectSecurity(AdminInterface $admin, $object)
  45. {
  46. }
  47. }