This commit is contained in:
@@ -24,17 +24,15 @@ namespace AyaNova.Biz
|
|||||||
BizType = AyaType.FormCustom;
|
BizType = AyaType.FormCustom;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static FormCustomBiz GetBiz(AyContext ct, Microsoft.AspNetCore.Http.HttpContext httpContext)
|
internal static FormCustomBiz GetBiz(AyContext ct, Microsoft.AspNetCore.Http.HttpContext httpContext = null)
|
||||||
{
|
{
|
||||||
|
if (httpContext != null)
|
||||||
return new FormCustomBiz(ct, UserIdFromContext.Id(httpContext.Items), UserLocaleIdFromContext.Id(httpContext.Items), UserRolesFromContext.Roles(httpContext.Items));
|
return new FormCustomBiz(ct, UserIdFromContext.Id(httpContext.Items), UserLocaleIdFromContext.Id(httpContext.Items), UserRolesFromContext.Roles(httpContext.Items));
|
||||||
|
else//when called internally for internal ops there will be no context so need to set default values for that
|
||||||
|
return new FormCustomBiz(ct, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.BizAdminFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //Version for internal use
|
|
||||||
// internal static FormCustomBiz GetBizInternal(AyContext ct)
|
|
||||||
// {
|
|
||||||
// return new FormCustomBiz(ct, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.BizAdminFull);
|
|
||||||
// }
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//EXISTS
|
//EXISTS
|
||||||
|
|||||||
@@ -38,16 +38,15 @@ namespace AyaNova.Biz
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static UserBiz GetBiz(AyContext ct, Microsoft.AspNetCore.Http.HttpContext httpContext)
|
internal static UserBiz GetBiz(AyContext ct, Microsoft.AspNetCore.Http.HttpContext httpContext = null)
|
||||||
{
|
{
|
||||||
return new UserBiz(ct, UserIdFromContext.Id(httpContext.Items), UserLocaleIdFromContext.Id(httpContext.Items), UserRolesFromContext.Roles(httpContext.Items));
|
if (httpContext != null)
|
||||||
|
return new UserBiz(ct, UserIdFromContext.Id(httpContext.Items), UserLocaleIdFromContext.Id(httpContext.Items), UserRolesFromContext.Roles(httpContext.Items));
|
||||||
|
else//when called internally for internal ops there will be no context so need to set default values for that
|
||||||
|
return new UserBiz(ct, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.BizAdminFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //Version for internal use
|
|
||||||
// internal static UserBiz GetBizInternal(AyContext ct)
|
|
||||||
// {
|
|
||||||
// return new UserBiz(ct, 1, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, AuthorizationRoles.BizAdminFull);
|
|
||||||
// }
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//CREATE
|
//CREATE
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace AyaNova.Util
|
|||||||
//Create and save to db
|
//Create and save to db
|
||||||
using (var cct = ServiceProviderProvider.DBContext)
|
using (var cct = ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
await FormCustomBiz.GetBizInternal(cct).CreateAsync(fc);
|
await FormCustomBiz.GetBiz(cct).CreateAsync(fc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,7 +516,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
using (var ct = ServiceProviderProvider.DBContext)
|
using (var ct = ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
UserBiz Biz = UserBiz.GetBizInternal(ct);
|
UserBiz Biz = UserBiz.GetBiz(ct);
|
||||||
|
|
||||||
//allow creation of not entirely ready users (missing client id or subcontractor vendor id etc)
|
//allow creation of not entirely ready users (missing client id or subcontractor vendor id etc)
|
||||||
Biz.SeedOrImportRelaxedRulesMode = true;
|
Biz.SeedOrImportRelaxedRulesMode = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user