You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cache.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Created by robin on 11/1/15.
  3. */
  4. (function () {
  5. 'use strict';
  6. angular.module('luticateAuth')
  7. .factory('luticateAuthCacheDataAccess', ['localStorageService', function (localStorageService) {
  8. var luticateAuthCache = {};
  9. luticateAuthCache.setUser = function(user)
  10. {
  11. localStorageService.set('lu_user', user);
  12. };
  13. luticateAuthCache.getUser = function()
  14. {
  15. return localStorageService.get('lu_user');
  16. };
  17. luticateAuthCache.removeUser = function()
  18. {
  19. localStorageService.remove('lu_user');
  20. };
  21. luticateAuthCache.setEffectivePermissions = function(permissions)
  22. {
  23. localStorageService.set('lu_effective_permissions', permissions);
  24. };
  25. luticateAuthCache.getEffectivePermissions = function()
  26. {
  27. return localStorageService.get('lu_effective_permissions');
  28. };
  29. luticateAuthCache.removeEffectivePermissions = function()
  30. {
  31. localStorageService.remove('lu_effective_permissions');
  32. };
  33. luticateAuthCache.setEffectiveSettings = function(settings)
  34. {
  35. localStorageService.set('lu_effective_settings', settings);
  36. };
  37. luticateAuthCache.getEffectiveSettings = function()
  38. {
  39. return localStorageService.get('lu_effective_settings');
  40. };
  41. luticateAuthCache.removeEffectiveSettings = function()
  42. {
  43. localStorageService.remove('lu_effective_settings');
  44. };
  45. return luticateAuthCache;
  46. }]);
  47. })();