AuthorizationServiceInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Api;
  7. use Magento\Framework\Exception\LocalizedException;
  8. /**
  9. * Interface for integration permissions management.
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface AuthorizationServiceInterface
  15. {
  16. /**#@+
  17. * Permission type
  18. */
  19. const PERMISSION_ANONYMOUS = 'anonymous';
  20. const PERMISSION_SELF = 'self';
  21. /**#@- */
  22. /**
  23. * Grant permissions to user to access the specified resources.
  24. *
  25. * @param int $integrationId
  26. * @param string[] $resources List of resources which should be available to the specified user.
  27. * @return void
  28. * @throws LocalizedException
  29. */
  30. public function grantPermissions($integrationId, $resources);
  31. /**
  32. * Grant permissions to the user to access all resources available in the system.
  33. *
  34. * @param int $integrationId
  35. * @return void
  36. * @throws LocalizedException
  37. */
  38. public function grantAllPermissions($integrationId);
  39. /**
  40. * Remove role and associated permissions for the specified integration.
  41. *
  42. * @param int $integrationId
  43. * @return void
  44. * @throws LocalizedException
  45. */
  46. public function removePermissions($integrationId);
  47. }