Hi,
Can you please share the steps to reproduce? thanks.
Hi,
Is there any error log or steps I can reproduce the problem?
ExtraPropertity only Saved for the first one
You can try to bulk update users:
foreach (var user in users)
{
var number = await serialNumberMoreAppService.GetNextValueAsync();
user.SetProperty(ChangeUserConsts.NumberIdPropertityName, number);
}
repository.UpdateManyAsync(users);
Only return users of current tenant.
Are you using a separate database for tenants?
If so , you need to query all tenants and change the current tenant:
var tenants = await TenantRepository.GetListAsync();
foreach(var tenant in tenants)
{
using(CurrentTenant.Change(tenant.Id))
{
var users = ....;
foreach(var user in users)
{
var number = ...
user.Setproperty....
}
repository.UpdateManyAsync(users);
}
}
Hi,
I have checked.
It works for me:
But, it's not a good solution, because RequireAuthorization protects all controllers, including Elsa's API controllers. It's like adding [AuthorizeAttribute] to all controllers.
It breaks the default behavior of all controllers, even though it doesn't require authorization.
You can check this: https://community.abp.io/posts/using-elsa-workflow-with-the-abp-framework-773siqi9 . It explains protecting elsa dashboard pages based on permissions
For API endpoints, you can try this:
public class ElsaActionFilter: IAsyncActionFilter, ITransientDependency
{
private readonly ICurrentUser _currentUser;
private readonly IPermissionChecker _permissionChecker;
public ElsaActionFilter(IPermissionChecker permissionChecker, ICurrentUser currentUser)
{
_permissionChecker = permissionChecker;
_currentUser = currentUser;
}
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
if (context.Controller.GetType().FullName.StartsWith("Elsa.Server.Api.Endpoints"))
{
//elsa api endpoint
if (!_currentUser.IsAuthenticated)
{
context.Result = new UnauthorizedResult();
return;
}
if (!await _permissionChecker.IsGrantedAsync("PermissionName..."))
{
context.Result = new UnauthorizedResult();
return;
}
await next();
}
else
{
await next();
}
}
}
Hi,
we will check it out.
Hi,
Can you share a project? shiwei.liang@volosoft.com
Hi,
See: https://github.com/abpframework/abp/issues/7560#issuecomment-772413041
Can you try this?
public class UserNumberIdsResetAppService : ApplicationService, IUserNumberIdsResetAppService
{
public async Task Reset()
{
IIdentityUserRepository userRepository = this.LazyServiceProvider.LazyGetRequiredService();
ISerialNumberMoreAppService serialNumberMoreAppService = this.LazyServiceProvider.LazyGetRequiredService();
List users;
using (this.DataFilter.Disable())
{
users = await userRepository.GetListAsync(userName: "10093@ok.no");
}
foreach(var user in users)
{
long number = await serialNumberMoreAppService.GetNextValueAsync();
user.SetProperty("NumberId", number);
}
}
}
And I see that you are using ISerialNumberMoreAppService in the UserNumberIdsResetAppService ,
we do not recommend using another app service within an app service, you may need an ISerialNumberMoreManager.
Hi
The chart is not a feature of ABP, we use the popular library.
You can use any library you know, for example: https://mdbootstrap.com/docs/angular/advanced/charts/
Hi,
CLUSTERDOWN The cluster is down
It seems not related to ABP but Redis, can you check the Redis server?
HI,
Is your problem solved? I see the question closed.