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