Преглед изворни кода

permissions user add/edit/delete/get

tags/0.1.0
Robin Thoni пре 9 година
родитељ
комит
403fdb9c1c
1 измењених фајлова са 39 додато и 0 уклоњено
  1. 39
    0
      src/permissionsuser.js

+ 39
- 0
src/permissionsuser.js Прегледај датотеку

@@ -0,0 +1,39 @@
1
+/**
2
+ * Created by robin on 11/1/15.
3
+ */
4
+
5
+(function () {
6
+    'use strict';
7
+    angular.module('luticateAuth')
8
+        .factory('luticateAuthPermissionsUser', ['luticateRequest',
9
+            function(luticateRequest) {
10
+
11
+                var luticateAuthPermissions = {};
12
+
13
+                luticateAuthPermissions.getAll = function(data, promise)
14
+                {
15
+                    return luticateRequest.get("/api/luticate/permissions/user/" + data.user_id, data, promise);
16
+                };
17
+
18
+                luticateAuthPermissions.edit = function(data, promise)
19
+                {
20
+                    return luticateRequest.post("/api/luticate/permissions/user/" + data.user_id
21
+                        + "/" + data.permission_name + "/edit/" + data.permission_value, null, null, promise);
22
+                };
23
+
24
+                luticateAuthPermissions.add = function(data, promise)
25
+                {
26
+                    return luticateRequest.post("/api/luticate/permissions/user/" + data.user_id
27
+                        + "/add/" + data.permission_name + "/" + data.permission_value, null, null, promise);
28
+                };
29
+
30
+                luticateAuthPermissions.del = function(data, promise)
31
+                {
32
+                    return luticateRequest.post("/api/luticate/permissions/user/" + data.user_id
33
+                        + "/" + data.permission_name + "/del", null, null, promise);
34
+                };
35
+
36
+
37
+                return luticateAuthPermissions;
38
+        }]);
39
+})();

Loading…
Откажи
Сачувај