Guest User

Untitled

a guest
Feb 8th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. {
  2. Client is not authorized to access this resource: ResourceName
  3. }
  4.  
  5. request({
  6. url: this.url+endpoint,
  7. method: 'GET',
  8. headers:{
  9. 'Authorization': 'Bearer '+bearer,
  10. 'User-Agent': '...',
  11. 'Accept' : 'application/json',
  12. 'Content-Type': 'application/json'
  13. }
  14. }, (error, response, body) => {
  15. callback(error,response,body)
  16. })
  17.  
  18. })
  19.  
  20. request({
  21. url: this.url+'integration/admin/token',
  22. method: 'POST',
  23. json:{
  24. username: this.username,
  25. password: this.password
  26. }
  27. }, (error, response, body) => {
  28. callback(body)
  29. })
  30.  
  31. public function isAllowed($resource, $privilege = null)
  32. {
  33. return $this->_aclPolicy->isAllowed($this->_aclRoleLocator-
  34. >getAclRoleId(), $resource, $privilege);
  35. }
  36.  
  37. return true
  38.  
  39. getAclRoleId()
  40.  
  41. namespace MagentoFrameworkAuthorizationRoleLocator;
  42.  
  43. class DefaultRoleLocator implements
  44. MagentoFrameworkAuthorizationRoleLocatorInterface
  45. {
  46. /**
  47. * Retrieve current role
  48. *
  49. * @return string
  50. */
  51. public function getAclRoleId()
  52. {
  53. return '';
  54.  
  55. }
  56. }
Add Comment
Please, Sign In to add comment