Open Closed

Renaming Role Still Loses Permission on v5.2.1 #3005


User avatar
0
adrianl created

Hi,

We've already updated our ABP and we're now currently using the version 5.2.1 but we still encounter this problem that when renaming roles, it loses all the permissions checked before renaming the role. I've already tried to relogin but still the issue still persists.

  • ABP Framework version: v5.2.1
  • UI type: Blazor
  • DB provider: EF Core

20 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I will check it out

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I could not reproduce the problem, can you share a project with me? shiwei.liang@volosoft.com

  • User Avatar
    0
    adrianl created

    Hi,

    Please validate first the checked permissions on the role before renaming the role. Then check again the permissions assigned to that role after renaming it.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    It will fail when changing the role name, but after refreshing the page everything works fine.

  • User Avatar
    0
    adrianl created

    I tried refreshing but still loses permission. Here's the actual scenario on our end:

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I still could not reproduce the problem

    Can you share a simple project with me? shiwei.liang@volosoft.com

  • User Avatar
    0
    adrianl created

    Hi,

    Our project is quite large already and a bit complicated if we drill it down to a simple project for this scenario. Is it possible that we have a meeting and we can sharescreen and give control so you can check on our end?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Ok, please email me when you are free.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Is your problem solved? I didn't receive your email.

  • User Avatar
    0
    adrianl created

    Hi Liang,

    Sorry I haven't got back to you. We can use google meet to have a call for this: https://meet.google.com/hyq-mdfp-gax

    You can add me also on google chat and let me know if we can start the sharescreen session: adrianlibrando@gmail.com Thanks

  • User Avatar
    0
    adrianl created

    Hi Liang,

    I have got rid already the warning message from rabbit mq and we still encounter the problem. Also I've discussed it with my teammate already about the question you've sent and it seems the recommended fix there was already implemented on our project.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Is there any error log?

  • User Avatar
    0
    adrianl created

    No error logs so far. You may try to reproduce by including the AbpEventBusRabbitMqModule on the application module.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Ok, I will check it and reply to you back.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi Liang,

    I have got rid already the warning message from rabbit mq and we still encounter the problem. Also I've discussed it with my teammate already about the question you've sent and it seems the recommended fix there was already implemented on our project.

    https://support.abp.io/QA/Questions/2423/RabbitMQ-not-getting-triggered-it-just-throws-exception-when-publishing-event-to-Identity-Microservice#answer-2ae7888b-383b-d319-0d4a-3a0168fcc5d2

    I have checked, and it works.

    What fix steps did you do? Or I can check it remotely.

  • User Avatar
    0
    adrianl created

    Hi Liang,

    I have got rid already the warning message from rabbit mq and we still encounter the problem. Also I've discussed it with my teammate already about the question you've sent and it seems the recommended fix there was already implemented on our project.

    https://support.abp.io/QA/Questions/2423/RabbitMQ-not-getting-triggered-it-just-throws-exception-when-publishing-event-to-Identity-Microservice#answer-2ae7888b-383b-d319-0d4a-3a0168fcc5d2

    I have checked, and it works.

    What fix steps did you do? Or I can check it remotely.

    We tried to manually removed the x-dead-letter-exchange on the queue on rabbitMQ and the warning message was removed. Let's set a remote session by tomorrow. I'll be emailing you an invite link to zoom tomorrow

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Is your problem solved? I didn't receive your email.

  • User Avatar
    0
    adrianl created

    Hi,

    Sorry got busy on some other Tasks. I've sent a link for the zoom meeting invite for later. Let me know if you'll be able to join the meeting today. Thanks.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    It's a bug: https://github.com/abpframework/abp/issues/12665

    We will fix it, your ticket will be refunded. for now, you can try this:

    public class MyRoleUpdateEventHandler :
        IDistributedEventHandler<IdentityRoleNameChangedEto>,
        ITransientDependency
    {
        protected IPermissionManager PermissionManager { get; }
        protected IPermissionGrantRepository PermissionGrantRepository { get; }
        
        protected ICurrentTenant CurrentTenant { get; }
    
        public MyRoleUpdateEventHandler(
            IPermissionManager permissionManager,
            IPermissionGrantRepository permissionGrantRepository, 
            ICurrentTenant currentTenant)
        {
            PermissionManager = permissionManager;
            PermissionGrantRepository = permissionGrantRepository;
            CurrentTenant = currentTenant;
        }
    
        public async Task HandleEventAsync(IdentityRoleNameChangedEto eventData)
        {
            using (CurrentTenant.Change(eventData.TenantId))
            {
                var permissionGrantsInRole = await PermissionGrantRepository.GetListAsync(RolePermissionValueProvider.ProviderName, eventData.OldName);
                foreach (var permissionGrant in permissionGrantsInRole)
                {
                    await PermissionManager.UpdateProviderKeyAsync(permissionGrant, eventData.Name);
                }
            }
        }
    }
    
  • User Avatar
    0
    adrianl created

    Hi,

    The provided code fix is now working as expected. Thank you very much for the assistance.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09