Activities of "liangshiwei"

Just

public async Task CustomUserImageUpdate(string userId, IBlobContainer lobContainer, string image)
{
 try
 {
     byte[] imageBytes = Convert.FromBase64String(image);
     await lobContainer.SaveAsync(userId, imageBytes, true);
     await SettingManager.SetForUserAsync(userId, AccountSettingNames.ProfilePictureSource, "2");
 }
 catch (Exception ex)
 {

     throw;
 }
}

Hi,

Try:

User.SetIsActive(false);
Answer

Hi,

If your answer is negative on either question

The Saas module is designed to assign a single edition to a tenant; it can't assign multiple editions.

As I understand, you want user-level feature control. I think you can do this with Features.

First, you can use the Entity extension to add EditionId for the user.

  • Once the user pays, you need to set EditionId for the user

And add a new FeatureValueProvider:

public class UserEditionFeatureValueProvider : FeatureManagementProvider, ITransientDependency
{
    public override string Name => "TE";

    private readonly ICurrentPrincipalAccessor _currentPrincipalAccessor;

    public UserEditionFeatureValueProvider(
        IFeatureStore featureStore,
        ICurrentPrincipalAccessor currentPrincipalAccessor)
        : base(featureStore)
    {
        _currentPrincipalAccessor = currentPrincipalAccessor;
    }

    public async override Task<string> GetOrNullAsync(FeatureDefinition feature)
    {
        // find the EditionId for current user, you can use cache or claims for performance
        var user = await UserRepository.GetAsync(...currentUserId);
        var userEditionId = user.GetProperty<string>("EditionId");
        if(userEditionId.IsNullOrWhiteSpace())
        {
            return null;
        }
        
         return await Store.GetOrNullAsync(feature.Name, EditionFeatureValueProvider.ProviderName, userEditionId);
    }
}

Related document:

  • https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#quick-example
  • https://docs.abp.io/en/abp/latest/Features
  • https://docs.abp.io/en/commercial/latest/modules/payment#one-time-payments

Hi,

I created an issue for this. You can check: https://github.com/abpframework/abp/issues/19656

Your ticket was refunded.

Hi,

Hi, you can set the ProfilePictureSource setting for a user.

await SettingManager.SetForUserAsync(userId, AccountSettingNames.ProfilePictureSource, "2");

2 is Image

Hi,

You can override the register method to set the IsActive value to true

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IAccountAppService))]
public class MyAccountAppService : AccountAppService
{
    public override async Task<IdentityUserDto> RegisterAsync(RegisterDto input)
    {
        await CheckSelfRegistrationAsync();

        if (await UseCaptchaOnRegistration())
        {
            var reCaptchaValidator = await RecaptchaValidatorFactory.CreateAsync();
            await reCaptchaValidator.ValidateAsync(input.CaptchaResponse);
        }

        await IdentityOptions.SetAsync();

        var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id);
        
        user.IsActive = false; // inactive user
        
        input.MapExtraPropertiesTo(user);

        (await UserManager.CreateAsync(user, input.Password)).CheckErrors();
        (await UserManager.AddDefaultRolesAsync(user)).CheckErrors();

        if (!user.EmailConfirmed)
        {
            await SendEmailConfirmationTokenAsync(user, input.AppName, input.ReturnUrl, input.ReturnUrlHash);
        }

        return ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
    }
}

And override the error message:

https://github.com/abpframework/abp/blob/d6063204f41e9cb9e57d7c2592d866735d970c9a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json#L13

https://docs.abp.io/en/abp/latest/Localization#extending-existing-resource

Hi,

InitialSelect2 is not a method provided by ABP.

Could you share a simple project to reproduce the problem? I will check it. thanks. shiwei.liang@volosoft.com

Hi,

You can add your own IAuthorizationRequirement to check the scope and child scope.

Here is a simpler way:

You can check scope in middleware:

app.Use(async (context, next) =>
{
    if (context.Request.Path.ToString().Contains("/api/audit-logging"))
    {
        // check users's ciaml here.
    }
    await next();
});

Hi,

You can try something like this: https://stackoverflow.com/questions/71769968/asp-net-core-web-api-use-roles-and-requiredscope-concurrent

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(AuditLogsController))]
[Authorize("auditlogging")]
public class MyAuditController : AuditLogsController
{
    public MyAuditController(IAuditLogsAppService auditLogsAppService) : base(auditLogsAppService)
    {
    }
}
Showing 2101 to 2110 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 04, 2025, 06:41