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