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.

permissions.controller.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. angular.module('luticate')
  2. .controller('PermissionsController', ['$scope', 'luticateAuthPermissions', 'luticateAuthCache',
  3. function($scope, luticateAuthPermissions, luticateAuthCache) {
  4. $scope.luTable = {
  5. columns: [
  6. {
  7. name: "Name",
  8. width: 6,
  9. getValue: function (item) {
  10. return item.Name;
  11. }
  12. }, {
  13. name: "Value",
  14. width: 5,
  15. getValue: function (item) {
  16. return item.Value ? "Allowed" : "Disallowed";
  17. }
  18. }
  19. ],
  20. canAdd: 'LU_PERM_ADD',
  21. canDel: 'LU_PERM_DEL',
  22. canEdit: function()
  23. {
  24. return true;
  25. },
  26. getLoadPagePromise: function (page, perPage, query, promise) {
  27. return luticateAuthPermissions.getAll({page: page, perPage: perPage, query: query}, promise);
  28. },
  29. getDelPromise: function (id, promise) {
  30. return luticateAuthPermissions.del({permission_name: id}, promise);
  31. },
  32. getEditController: function () {
  33. return "PermissionEdit";
  34. },
  35. getItemId: function (item) {
  36. return item.Name;
  37. },
  38. perPage: luticateAuthCache.getEffectiveSettingValue("LU_PERMISSIONS_PER_PAGE")
  39. }
  40. }]);