Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. $scope.genres = [];
  2.  
  3. Genre.find().$promise.then(function(res) { //this request works : goes to GET /Genres endpoint
  4. $scope.genres = res;
  5. $scope.genres.forEach(function(genre) {
  6.  
  7. genre.checked=false;
  8. genre.subgenres = [];
  9. Genre.subGenres({id: genre.id}).$promise.then(function(r){ //it is this one that doesn't work, GET /Genres/:id/SubGenre endpoint
  10.  
  11. genre.subgenres = r;
  12. genre.subgenres.forEach(function(s){
  13. s.checked=false;
  14. });
  15. });
  16. });
  17. });
  18.  
  19. // INTERNAL. Use SubGenre.genres() instead.
  20. "prototype$__get__genres": {
  21. isArray: true,
  22. url: urlBase + "/SubGenres/:id/genres",
  23. method: "GET"
  24. },
  25.  
  26. "acls": [
  27. {
  28. "accessType": "*",
  29. "principalType": "ROLE",
  30. "principalId": "$everyone",
  31. "permission": "DENY"
  32. },
  33. {
  34. "accessType": "EXECUTE",
  35. "principalType": "ROLE",
  36. "principalId": "$authenticated",
  37. "permission": "ALLOW",
  38. "property": "subGenres" // this is to authorize Genre.subGenre(), doesn't works => 401 error.
  39. },
  40. {
  41. "accessType": "EXECUTE",
  42. "principalType": "ROLE",
  43. "principalId": "$authenticated",
  44. "permission": "ALLOW",
  45. "property": "find" // this is to authorize Genre.find(), it works
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement