Hi,
You can use the ABP Suite to install file management module to your project.
The file management provided some repositories: https://docs.abp.io/en/commercial/latest/modules/file-management#repositories
Hi,
Actualy, the modal page and ParentPage are same page. modal pages can call variables from the parent page. you need to change the variable scope of the parent page. like
parent page.
var modal;
$(function(){
modal = new abp.ModalManager()....
})
modal page:
$(function(){
modal.setResult....
})
HI,
We will fix it by https://github.com/abpframework/abp/pull/7804
For now , you can try:
public class MyAbpUowActionFilter : IAsyncActionFilter, ITransientDependency
{
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
if (!context.ActionDescriptor.IsControllerAction())
{
await next();
return;
}
var methodInfo = context.ActionDescriptor.GetMethodInfo();
var unitOfWorkAttr = UnitOfWorkHelper.GetUnitOfWorkAttributeOrNull(methodInfo);
context.HttpContext.Items["_AbpActionInfo"] = new AbpActionInfoInHttpContext
{
IsObjectResult = context.ActionDescriptor.HasObjectResult()
};
if (unitOfWorkAttr?.IsDisabled == true)
{
await next();
return;
}
var options = CreateOptions(context, unitOfWorkAttr);
var unitOfWorkManager = context.HttpContext.RequestServices.GetRequiredService<IUnitOfWorkManager>();
//Trying to begin a reserved UOW by AbpUnitOfWorkMiddleware
if (unitOfWorkManager.TryBeginReserved(UnitOfWork.UnitOfWorkReservationName, options))
{
var result = await next();
if (!Succeed(result))
{
await RollbackAsync(context, unitOfWorkManager);
}
return;
}
//Begin a new, independent unit of work
using (var uow = unitOfWorkManager.Begin(options))
{
var result = await next();
if (Succeed(result))
{
await uow.CompleteAsync(context.HttpContext.RequestAborted);
}
else
{
await uow.RollbackAsync(context.HttpContext.RequestAborted);
}
}
}
private AbpUnitOfWorkOptions CreateOptions(ActionExecutingContext context,
UnitOfWorkAttribute unitOfWorkAttribute)
{
var options = new AbpUnitOfWorkOptions();
unitOfWorkAttribute?.SetOptions(options);
if (unitOfWorkAttribute?.IsTransactional == null)
{
var abpUnitOfWorkDefaultOptions =
context.HttpContext.RequestServices.GetRequiredService<IOptions<AbpUnitOfWorkDefaultOptions>>().Value;
options.IsTransactional = abpUnitOfWorkDefaultOptions.CalculateIsTransactional(
autoValue: !string.Equals(context.HttpContext.Request.Method, HttpMethod.Get.Method,
StringComparison.OrdinalIgnoreCase)
);
}
return options;
}
private async Task RollbackAsync(ActionExecutingContext context, IUnitOfWorkManager unitOfWorkManager)
{
var currentUow = unitOfWorkManager.Current;
if (currentUow != null)
{
await currentUow.RollbackAsync(context.HttpContext.RequestAborted);
}
}
private static bool Succeed(ActionExecutedContext result)
{
return result.Exception == null || result.ExceptionHandled;
}
}
Configure<MvcOptions>(options =>
{
options.Filters.RemoveAll(x => x.GetType() == typeof(AbpUowActionFilter));
options.Filters.Add<MyAbpUowActionFilter>();
});
AbpUowPageFilter also.
Hi,
May be you can use proxifier to proxy abp suite.
Hi,
You should use file management module, the blob system is a low-level module.
Hi,
https://github.com/PontusLjungdahl/abpbook2
Please remove the repo on Github, because the source code has your linence key, it's not safe for you.
Try
public class EntitiesPermissionValueProvider : PermissionValueProvider
{
public override string Name => "UE";
public EntitiesPermissionValueProvider(IPermissionStore permissionStore)
: base(permissionStore)
{
}
public override Task<PermissionGrantResult> CheckAsync(PermissionValueCheckContext context)
{
if (CheckAsync(context.Principal))
{
return Task.FromResult(PermissionGrantResult.Granted);
}
return Task.FromResult(PermissionGrantResult.Undefined);
}
public override Task<MultiplePermissionGrantResult> CheckAsync(PermissionValuesCheckContext context)
{
var permissionNames = context.Permissions.Select(x => x.Name).ToArray();
if (CheckAsync(context.Principal))
{
return Task.FromResult(new MultiplePermissionGrantResult(permissionNames, PermissionGrantResult.Granted));
}
return Task.FromResult(new MultiplePermissionGrantResult(permissionNames, PermissionGrantResult.Undefined));
}
private bool CheckAsync(ClaimsPrincipal principal)
{
return principal?.FindFirst("User_Type")?.Value == "SystemAdmin";
}
}
Hi,
Add tenants by code ....
For users, roles, you can refer : https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs#L70
For tenantns, you can use TenantAppService.CreateAsync
method. it will also initialize the tenant data.
https://github.com/abpframework/abp/blob/dev/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantAppService.cs#L52
For organisations, you can inject IOrganizationUnitManager
to create , delete ... an organisation.
Delete old tenants
You just need to inject Repositpry
and use DeleteAsync
mehtod , like https://github.com/abpframework/abp/blob/dev/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantAppService.cs#L94