Guest User

Untitled

a guest
Feb 7th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 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->getAclRoleId(), $resource, $privilege);
  34. }
  35.  
  36. return true
  37.  
  38. getAclRoleId()
  39.  
  40. namespace MagentoFrameworkAuthorizationRoleLocator;
  41.  
  42. class DefaultRoleLocator implements
  43. MagentoFrameworkAuthorizationRoleLocatorInterface
  44. {
  45. /**
  46. * Retrieve current role
  47. *
  48. * @return string
  49. */
  50. public function getAclRoleId()
  51. {
  52. return '';
  53.  
  54. }
  55. }
Add Comment
Please, Sign In to add comment