Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

userpermissions.controller.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Created by robin on 11/2/15.
  3. */
  4. angular.module('luticate')
  5. .controller('UserPermissionsController', ['$scope', 'luticateAuthPermissionsUser', 'data',
  6. function($scope, luticateAuthPermissionsUser, data) {
  7. $scope.user = data;
  8. $scope.luPermissionEdit = {
  9. item: $scope.user,
  10. permissions: {
  11. add: 'LU_PERM_USER_ADD',
  12. del: 'LU_PERM_USER_DEL',
  13. edit: 'LU_PERM_USER_EDIT'
  14. },
  15. getGetAllPromise: function (page, perPage, promise) {
  16. return luticateAuthPermissionsUser.getAll({
  17. user_id: this.item.Id,
  18. page: page,
  19. perPage: perPage
  20. }, promise);
  21. },
  22. getAddPermissionPromise: function (permission_name, permission_value, promise) {
  23. return luticateAuthPermissionsUser.add({
  24. user_id: this.item.Id,
  25. permission_name: permission_name,
  26. permission_value: permission_value
  27. }, promise);
  28. },
  29. getEditPermissionPromise: function (permission_name, permission_value, promise) {
  30. return luticateAuthPermissionsUser.edit({
  31. user_id: this.item.Id,
  32. permission_name: permission_name,
  33. permission_value: permission_value
  34. }, promise);
  35. },
  36. getDelPermissionPromise: function (permission_name, promise) {
  37. return luticateAuthPermissionsUser.del({
  38. user_id: this.item.Id,
  39. permission_name: permission_name
  40. }, promise);
  41. }
  42. };
  43. }]);