Deleting module with roles | Roles still get active

Hi guys,


I want to share what I think is a bug in the metamodel of the platform, or at least an error-prone situation.

When deleting an eSpace with roles, that eSpace gets the IS_ACTIVE flag with value FALSE in the database (as it should) but its roles still have the IS_ACTIVE flag with TRUE.

This can cause some issues hard to pinpoint on situations of external authentication when you receive the roles in the payload and you need to revoke all and grant those, when your roles were first created in an eSpace which was deleted.

The following things happen in that scenario:

  • When you do a get Role by Name query with IS_ACTIVE = True, you will get the "inactive" one since it is still marked as active and its id is smaller than the new one you have as it was created first;
  • The record will exist in the User_Role table but users will not be granted that role since it is deleted;
  • You will not see that role in the Users application interface.


Personally, I definitely think the Roles should get the IS_ACTIVE = False when you delete the eSpace they belong to. In any case, while this remains as is, when you are getting a role via query, make sure you join with the eSpace and filter by eSpace.IS_ACTIVE = TRUE, to overcome this situation.


Best regards,

João Marques

João Marques wrote:

Hi guys,


I want to share what I think is a bug in the metamodel of the platform, or at least an error-prone situation.

When deleting an eSpace with roles, that eSpace gets the IS_ACTIVE flag with value FALSE in the database (as it should) but its roles still have the IS_ACTIVE flag with TRUE.

This can cause some issues hard to pinpoint on situations of external authentication when you receive the roles in the payload and you need to revoke all and grant those, when your roles were first created in an eSpace which was deleted.

The following things happen in that scenario:

  • When you do a get Role by Name query with IS_ACTIVE = True, you will get the "inactive" one since it is still marked as active and its id is smaller than the new one you have as it was created first;
  • The record will exist in the User_Role table but users will not be granted that role since it is deleted;
  • You will not see that role in the Users application interface.


Personally, I definitely think the Roles should get the IS_ACTIVE = False when you delete the eSpace they belong to. In any case, while this remains as is, when you are getting a role via query, make sure you join with the eSpace and filter by eSpace.IS_ACTIVE = TRUE, to overcome this situation.


Best regards,

João Marques

 Thanks for sharing, will keep that in mind :)

Thanks,

Sachin

 

Hi João,

The problem is already reported to OutSystems as a bug. I will keep you posted on any news from OutSystems.

Regards,

Daniel