SecurityHandlerInterface.php 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. interface SecurityHandlerInterface
  13. {
  14. /**
  15. * @abstract
  16. * @param string|array $attributes
  17. * @param null $object
  18. * @return boolean
  19. */
  20. function isGranted(AdminInterface $admin, $attributes, $object = null);
  21. /**
  22. * @abstract
  23. * @param \Sonata\AdminBundle\Admin\AdminInterface $admin
  24. * @return void
  25. */
  26. function buildSecurityInformation(AdminInterface $admin);
  27. /**
  28. * Make the current user owner of the object
  29. *
  30. * @abstract
  31. * @param \Sonata\AdminBundle\Admin\AdminInterface $admin
  32. * @param object $object
  33. * @return void
  34. */
  35. function createObjectOwner(AdminInterface $admin, $object);
  36. }