angular.module('luticate') .controller('PermissionsController', ['$scope', 'luticateAuthPermissions', 'luticateAuthCache', function($scope, luticateAuthPermissions, luticateAuthCache) { $scope.luTable = { columns: [ { name: "Name", width: 6, getValue: function (item) { return item.Name; } }, { name: "Value", width: 5, getValue: function (item) { return item.Value ? "Allowed" : "Disallowed"; } } ], canAdd: 'LU_PERM_ADD', canDel: 'LU_PERM_DEL', canEdit: function() { return true; }, getLoadPagePromise: function (page, perPage, query, promise) { return luticateAuthPermissions.getAll({page: page, perPage: perPage, query: query}, promise); }, getDelPromise: function (id, promise) { return luticateAuthPermissions.del({permission_name: id}, promise); }, getEditController: function () { return "PermissionEdit"; }, getItemId: function (item) { return item.Name; }, perPage: luticateAuthCache.getEffectiveSettingValue("LU_PERMISSIONS_PER_PAGE") } }]);