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