internal SxcInstance(IContentBlock cb, ModuleInfo runtimeModuleInfo, IEnumerable<KeyValuePair<string, string>> urlparams = null)
{
ContentBlock = cb;
ModuleInfo = runtimeModuleInfo;
// try to get url parameters, because we may need them later for view-switching and more
Parameters = urlparams;
//if (Parameters == null)
// Parameters = HttpContext.Current?.Request?.QueryString; // todo: reduce dependency on context-current...
// Build up the environment. If we know the module context, then use permissions from there
// modinfo is null in cases where things are not known yet, portalsettings are null in search-scenarios
Environment.Permissions = (ModuleInfo != null) && (PortalSettings.Current != null)
? (IPermissions)new Permissions(ModuleInfo)
: new Environment.None.Permissions();
// url-override of view / data
CheckTemplateOverrides(); // allow view change on apps
}