NoopSecurityHandler.php 1.2 KB

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