GuestUserContext.php 534 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Webapi\Model\Authorization;
  7. use Magento\Authorization\Model\UserContextInterface;
  8. /**
  9. * Guest user context
  10. */
  11. class GuestUserContext implements UserContextInterface
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function getUserId()
  17. {
  18. return 0;
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function getUserType()
  24. {
  25. return UserContextInterface::USER_TYPE_GUEST;
  26. }
  27. }