NoopSecurityHandler.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  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. /**
  13. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  14. */
  15. class NoopSecurityHandler implements SecurityHandlerInterface
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function isGranted(AdminInterface $admin, $attributes, $object = null)
  21. {
  22. return true;
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getBaseRole(AdminInterface $admin)
  28. {
  29. return '';
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function buildSecurityInformation(AdminInterface $admin)
  35. {
  36. return array();
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function createObjectSecurity(AdminInterface $admin, $object)
  42. {
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function deleteObjectSecurity(AdminInterface $admin, $object)
  48. {
  49. }
  50. }