UserContextInterface.php 702 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Authorization\Model;
  7. /**
  8. * Interface for current user identification.
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface UserContextInterface
  14. {
  15. /**#@+
  16. * User type
  17. */
  18. const USER_TYPE_INTEGRATION = 1;
  19. const USER_TYPE_ADMIN = 2;
  20. const USER_TYPE_CUSTOMER = 3;
  21. const USER_TYPE_GUEST = 4;
  22. /**#@-*/
  23. /**
  24. * Identify current user ID.
  25. *
  26. * @return int|null
  27. * @api
  28. */
  29. public function getUserId();
  30. /**
  31. * Retrieve current user type.
  32. *
  33. * @return int|null
  34. * @api
  35. */
  36. public function getUserType();
  37. }