|
@@ -0,0 +1,46 @@
|
|
1
|
+/**
|
|
2
|
+ * Created by robin on 11/2/15.
|
|
3
|
+ */
|
|
4
|
+
|
|
5
|
+angular.module('luticate')
|
|
6
|
+ .controller('UserPermissionsController', ['$scope', 'luticateAuthPermissionsUser', 'data',
|
|
7
|
+ function($scope, luticateAuthPermissionsUser, data) {
|
|
8
|
+
|
|
9
|
+ $scope.user = data;
|
|
10
|
+
|
|
11
|
+ $scope.luPermissionEdit = {
|
|
12
|
+ item: $scope.user,
|
|
13
|
+
|
|
14
|
+ getGetAllPromise: function (page, perPage, promise) {
|
|
15
|
+ return luticateAuthPermissionsUser.getAll({
|
|
16
|
+ user_id: this.item.Id,
|
|
17
|
+ page: page,
|
|
18
|
+ perPage: perPage
|
|
19
|
+ }, promise);
|
|
20
|
+ },
|
|
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
|
+
|
|
30
|
+ getEditPermissionPromise: function (permission_name, permission_value, promise) {
|
|
31
|
+ return luticateAuthPermissionsUser.edit({
|
|
32
|
+ user_id: this.item.Id,
|
|
33
|
+ permission_name: permission_name,
|
|
34
|
+ permission_value: permission_value
|
|
35
|
+ }, promise);
|
|
36
|
+ },
|
|
37
|
+
|
|
38
|
+ getDelPermissionPromise: function (permission_name, promise) {
|
|
39
|
+ return luticateAuthPermissionsUser.del({
|
|
40
|
+ user_id: this.item.Id,
|
|
41
|
+ permission_name: permission_name
|
|
42
|
+ }, promise);
|
|
43
|
+ }
|
|
44
|
+ };
|
|
45
|
+
|
|
46
|
+ }]);
|