Browse Source

get effective permission

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
3bfc1b8ac8
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      src/cache.js

+ 10
- 0
src/cache.js View File

45
                 return localStorageService.get('lu_effective_permissions');
45
                 return localStorageService.get('lu_effective_permissions');
46
             };
46
             };
47
 
47
 
48
+            luticateAuthCache.hasEffectivePermissions = function(permission_name)
49
+            {
50
+                var permissions = luticateAuthCache.getEffectivePermissions();
51
+                if (permissions == null) {
52
+                    return null;
53
+                }
54
+                var value = permissions[permission_name];
55
+                return value == null ? null : value;
56
+            };
57
+
48
             luticateAuthCache.removeEffectivePermissions = function()
58
             luticateAuthCache.removeEffectivePermissions = function()
49
             {
59
             {
50
                 localStorageService.remove('lu_effective_permissions');
60
                 localStorageService.remove('lu_effective_permissions');

Loading…
Cancel
Save