Example #1
0
 asset.createUserAssetManager = function(session, type) {
     var server = require('store').server;
     var user = require('store').user;
     var userDetails = server.current(session);
     var userRegistry = user.userRegistry(session);
     var am = createAssetManager(session, userDetails.tenantId, userRegistry, type);
     am.r = createRenderer(session, userDetails.tenantId, type);
     return am;
 };
/*
 The class is used to encapsulate the managers used by the store
 @tenantId: The tenantId of the current tenant
 @session: The session of the currently logged in user
 */
function StoreMasterManager(tenantId, session) {
    var user = require('store').user;
    var registry = user.userRegistry(session);

    var managers = buildManagers(registry, tenantId);

    this.modelManager = managers.modelManager;
    this.rxtManager = managers.rxtManager;
    this.storageSecurityProvider = managers.storageSecurityProvider;
    this.tenantId = tenantId;
}
Example #3
0
 var getRegistry = function(cSession) {
     var userMod = require('store').user;
     var server = require('store').server;
     var user = server.current(cSession);
     var userRegistry;
     if (user) {
         userRegistry = userMod.userRegistry(cSession);
     } else {
         userRegistry = server.anonRegistry(tenantId);
     }
     return userRegistry;
 };
var Store = function (tenantId, session) {
    var assetManagers = {},
        mod = require('store'),
        user = mod.user,
        server = mod.server;
    this.tenantId = tenantId;
    this.servmod = server;
    this.assetManagers = assetManagers;
    if (session) {
        this.user = server.current(session);
        this.registry = user.userRegistry(session);
        this.session = session;
        this.userSpace = user.userSpace(this.user);
    } else {
        configs(tenantId).assets.forEach(function (type) {
            assetManagers[type] = assetManager(type, server.anonRegistry(tenantId));
        });
    }
};
Example #5
0
 var getRegistry = function(cSession) {
     var userMod = require('store').user;
     var userRegistry = userMod.userRegistry(cSession);
     return userRegistry;
 };