Roles still exist after Modules is deleted.
Application Type
Reactive

Hi Good day for everyone, I am just curious because after I delete the Module that contains Roles.
I can still access those Role, is there a solution to removed those or something that would clean it ?

mvp_badge
MVP
Solution

You may be able to workaround that by adding the Espace entity to your aggregate (Role Only With Espace) and filtering by the Espace.Is_Active attribute... That way any roles from (soft-)deleted modules would not be part of your result set.

Hope this helps!

mvp_badge
MVP

Hi Mobarak Dimalotang,

I believe this is a general consideration with managing dependencies. If Module A has a dependency on Module B, even if you delete Module B, Module A will still "see" the elements that are being referenced from Module B until you update the dependencies of Module A (because it is based on the version of Module B at the time those dependencies were last established/refreshed).

In your case, if existing modules have dependencies to those roles on the deleted module, only when you refresh the dependencies (and remove the module from them) will those roles disappear from the available roles in your modules.

Do you think this might be your issue?

Thank you for your reply Jorge, but what I mean is my newly created module (B) have no dependencies in the deleted module (A). I am bothered because even I delete the Module (A), those Roles from that module are still existing in Roles Entities of Module (B). What I mean is it should be deleted in Roles Entities, right ?


Best Regards,
Mobarak Dimalotang


mvp_badge
MVP

Can you share a screenshot of the expanded Roles folder from the Logic tab in Service Studio for module B?...

In order to be available in a module, Roles need to be:

  • the default Anonymous and Registered roles, that are always available;
  • defined in the current module (module B);
  • referenced from another module explicitly via the Manage Dependencies dialog (they will show up in a sub-folder named after the module they were defined on);


Thank you for you reply here is the Picture. I provide 2 picture and I'll explain it.
In the Picture 1 is the Roles I created for my newly module (B), and for the picture 2 is the Built-In Role Entities in Module (B), You can see that their was an duplication of Roles (Admin, Manager ,and Receptionist) in Role Entities which is some of it is from the deleted Module(A), and you can see also that their was an Role in Roles Entities that wasn't default like "Trainer", "Sales", "Registrar", "Professors" and other Roles that I created in Module (A) which is already gone.

Best Regards,
Mobarak



mvp_badge
MVP

Got it, you are querying the Role entity directly, not using the Service Studio UI to handle Roles. Could you explain how those records not having been deleted is impacting your development?  

I'm not sure if/when Role records are deleted, but Modules aren't immediately removed from the Database when you delete them (they are marked as deleted, which allows them to be recovered if needed, until more permanent cleanup is performed) so it could be related. Check the DB Cleaner on Steroids forge component to see if there is any cleanup pending that can be done (be very careful with how you use the component, it can permanently remove data and make it impossible for you to rollback to previous versions of modules, for instance).

I'll also ping the team at OutSystems so they can chime in here, in case I missed something...

Thanks  for the recommendation of that Forge Components and I'll look it up and try it, and the reason I use the Entities Role is because in my Users Adding/Updating screen I would like to use that entities to list the Roles in the Dropdown but it seems mess up because the rest of the Roles that should have been erased are still there, which I want to use it as assigning a Users on specific Roles.

mvp_badge
MVP
Solution

You may be able to workaround that by adding the Espace entity to your aggregate (Role Only With Espace) and filtering by the Espace.Is_Active attribute... That way any roles from (soft-)deleted modules would not be part of your result set.

Hope this helps!

Thanks Jorge, I solve it by using the Espace to show the list of Roles by current Application ID, so it only show the Roles of said Application. You are a champ

Regards,
Mobarak

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.