|
@@ -0,0 +1,61 @@
|
|
1
|
+/**
|
|
2
|
+ * Created by robin on 11/1/15.
|
|
3
|
+ */
|
|
4
|
+
|
|
5
|
+(function () {
|
|
6
|
+ 'use strict';
|
|
7
|
+ angular.module('luticateAuth')
|
|
8
|
+ .factory('luticateAuthPermissions', ['luticateRequest',
|
|
9
|
+ function(luticateRequest) {
|
|
10
|
+
|
|
11
|
+ var luticateAuthPermissions = {};
|
|
12
|
+
|
|
13
|
+ luticateAuthPermissions.getAll = function(data, promise)
|
|
14
|
+ {
|
|
15
|
+ return luticateRequest.get("/api/luticate/permissions", data, promise);
|
|
16
|
+ };
|
|
17
|
+
|
|
18
|
+ luticateAuthPermissions.edit = function(data, promise)
|
|
19
|
+ {
|
|
20
|
+ return luticateRequest.post("/api/luticate/permissions/" + data.permission_name + "/edit/"
|
|
21
|
+ + data.permission_value, null, null, promise);
|
|
22
|
+ };
|
|
23
|
+
|
|
24
|
+ luticateAuthPermissions.add = function(data, promise)
|
|
25
|
+ {
|
|
26
|
+ return luticateRequest.post("/api/luticate/permissions/add/" + data.permission_name + "/"
|
|
27
|
+ + data.permission_value, null, null, promise);
|
|
28
|
+ };
|
|
29
|
+
|
|
30
|
+ luticateAuthPermissions.del = function(data, promise)
|
|
31
|
+ {
|
|
32
|
+ return luticateRequest.post("/api/luticate/permissions/" + data.permission_name + "/del",
|
|
33
|
+ null, null, promise);
|
|
34
|
+ };
|
|
35
|
+
|
|
36
|
+ luticateAuthPermissions.getEffectiveUser = function(data, promise)
|
|
37
|
+ {
|
|
38
|
+ return luticateRequest.get("/api/luticate/permissions/effective/" + data.user_id
|
|
39
|
+ + "/" + data.permission_name, null, promise);
|
|
40
|
+ };
|
|
41
|
+
|
|
42
|
+ luticateAuthPermissions.getAllEffectiveUser = function(data, promise)
|
|
43
|
+ {
|
|
44
|
+ return luticateRequest.get("/api/luticate/permissions/effective/" + data.user_id, null, promise);
|
|
45
|
+ };
|
|
46
|
+
|
|
47
|
+ luticateAuthPermissions.getEffectiveMe = function(data, promise)
|
|
48
|
+ {
|
|
49
|
+ return luticateRequest.get("/api/luticate/permissions/effective/me/"
|
|
50
|
+ + data.permission_name, null, promise);
|
|
51
|
+ };
|
|
52
|
+
|
|
53
|
+ luticateAuthPermissions.getAllEffectiveMe = function(promise)
|
|
54
|
+ {
|
|
55
|
+ return luticateRequest.get("/api/luticate/permissions/effective/me", null, promise);
|
|
56
|
+ };
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+ return luticateAuthPermissions;
|
|
60
|
+ }]);
|
|
61
|
+})();
|