StorageInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Model\Auth\Credential;
  7. /**
  8. * Backend Auth Credential Storage interface
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface StorageInterface
  15. {
  16. /**
  17. * Authenticate process.
  18. *
  19. * @param string $username
  20. * @param string $password
  21. * @return bool
  22. */
  23. public function authenticate($username, $password);
  24. /**
  25. * Login action. Check if given username and password are valid
  26. *
  27. * @param string $username
  28. * @param string $password
  29. * @return $this
  30. * @abstract
  31. */
  32. public function login($username, $password);
  33. /**
  34. * Reload loaded (already authenticated) credential storage
  35. *
  36. * @return $this
  37. * @abstract
  38. */
  39. public function reload();
  40. /**
  41. * Check if user has available resources
  42. *
  43. * @return bool
  44. * @abstract
  45. */
  46. public function hasAvailableResources();
  47. /**
  48. * Set user has available resources
  49. *
  50. * @param bool $hasResources
  51. * @return $this
  52. * @abstract
  53. */
  54. public function setHasAvailableResources($hasResources);
  55. }