+ }else{
+ if(isFunction(fn)){
+ fn();
+ }
+ }
+
+ },
+ loadProjects: function(fn) {
+ user = JSON.parse(localStorage.getItem('user'));
+ projects = localStorage.getItem('projects');
+ if($.isEmptyObject(projects)){
+ if($.isEmptyObject(user) || $.isEmptyObject(user.parent_authority)){
+ $.post("/rest/myslice:user/",{'filters':{'user_hrn':'$user_hrn'},'fields':['parent_authority']}, function( data ) {
+ parent_authority = data[0].parent_authority;
+
+ });
+ }else{
+ parent_authority = user.parent_authority;
+ }
+ // REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2
+ $.post("/rest/authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+parent_authority}}, function( data ) {
+ localStorage.setItem('projects', JSON.stringify(data));
+ });
+ }else{
+ if(isFunction(fn)){
+ fn();
+ }