You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

groups.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Created by robin on 11/1/15.
  3. */
  4. (function () {
  5. 'use strict';
  6. angular.module('luticateAuth')
  7. .factory('luticateAuthGroups', ['luticateRequest',
  8. function(luticateRequest) {
  9. var luticateAuthGroups = {};
  10. luticateAuthGroups.getAll = function(data, promise)
  11. {
  12. return luticateRequest.get("/api/luticate/groups", data, promise);
  13. };
  14. luticateAuthGroups.edit = function(data, promise)
  15. {
  16. return luticateRequest.post("/api/luticate/groups/" + data.group_id + "/edit", data, null, promise);
  17. };
  18. luticateAuthGroups.add = function(data, promise)
  19. {
  20. return luticateRequest.post("/api/luticate/groups/add", data, null, promise);
  21. };
  22. luticateAuthGroups.del = function(data, promise)
  23. {
  24. return luticateRequest.post("/api/luticate/groups/" + data.group_id + "/del", null, null, promise);
  25. };
  26. luticateAuthGroups.usersGetAll= function(data, promise)
  27. {
  28. return luticateRequest.get("/api/luticate/groups/" + data.group_id + "/users",
  29. data, promise);
  30. };
  31. luticateAuthGroups.usersAdd = function(data, promise)
  32. {
  33. return luticateRequest.post("/api/luticate/groups/" + data.group_id + "/users/"
  34. + data.user_id + "/add", data, null, promise);
  35. };
  36. luticateAuthGroups.usersDel = function(data, promise)
  37. {
  38. return luticateRequest.post("/api/luticate/groups/" + data.group_id + "/users/"
  39. + data.user_id + "/del", data, null, promise);
  40. };
  41. return luticateAuthGroups;
  42. }]);
  43. })();