Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Heavy extension for the Abp Framework #2989


User avatar
0
bilalhaidar created

Hello, I am in need to extend the Abp Framework heavily. In this regard, I've prepared my requirements and what I will be changing. I am seeing your kind review to see if I am thinking correctly in terms of Abp and whether my changes would cause any issues to the normal flow of the Abp Framework and hence the entire App.

Host Level

. For every new department, an OU is created. . Upon creation of a new OU, 4 Roles are to be created & each of these roles is assigned the OU ID that it belongs to. . A new Role Entity is to be created inheriting from the Role entity that ships with Abp. This new entity shall have a new property called OU of type OU. (1-to-many: A Role belongs to 1 OU and 1 OU contains multiple Roles). . A new OU entity is to be created inheriting from the OU entity that ships with Abp. This new entity shall have a new property called OU Head of type User. (1-to-many: An OU has 1 OU Head and 1 User can be the head of multiple OUs) . When a new user is being created, for each OU-Role selected, the user shall be "Add Member" to those OUs. So, a user might be added to multiple Roles that belong to multiple OUs, hence user shall be added to multiple OUs as a Member. . Add a new Entity called Region that is shared between both Host and Tenant levels. . A new Tenant Entity is to be created inheriting from the Tenant entity that ships with Abp. This new entity shall have a new property called Region of type Region entity. (1-to-many: A Tenant belongs to 1 Region while a Region contains multiple Tenants). . A new User entity is to be created inheriting from the User entity that ships with Abp. This new entity shall have a new property called TenantsToAccess of type List<Tenant>. (Many-to-Many: A user can have access to 1 or more Tenants while a Tenant can be accessed by many users). This feature is required as by extending User and adding a property of Sites to be accessed, the Web App shall present data (Tenant-Specific) based on what Tenants this user belongs to.

Some analysis: . A Role entity now belongs to an OU entity. For each department in my client's organization, they will request in the future features to be developed for them. Features might be difference hence Permissions might be different. That's why I thought of creating OU-specific Roles so that I can freely add/remove permissions as needed. . The User entity now contains a list of Tenants a user belongs to (Host Level). Later on, based on the Tenants/Region data from those Tenants will be presented to the user. So this way I can simulate a Host User accessing data from multiple Tenants. Here I will be using SetTenantId(Null) and then add my own WHERE clause to get data.

Questions . Does the Abp Framework fire an event on the Event Bus when a new User is created? . Does the Abp Framework fire an event on the Event Bus when a new OU is created? . Does the Abp Framework fire an event on the Event Bus when an existing Role is edited?

Tenant Level . Most of the concepts from Host Level are applied here too. . One exception to the above is that when creating a new Tenant Level User automatically the user is assigned the current Tenant and Admin cannot change it.


7 Answer(s)
  • User Avatar
    0
    bilalhaidar created

    Any help pls?

    Thanks

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Your requirements seems possible to develop at first look. But, as you can understand, it's very hard for me to understand it fully and predict that where it can go further.

    . Does the Abp Framework fire an event on the Event Bus when a new User is created? -> YES . Does the Abp Framework fire an event on the Event Bus when a new OU is created? -> YES . Does the Abp Framework fire an event on the Event Bus when an existing Role is edited? -> YES

    Have a nice day.

  • User Avatar
    0
    bilalhaidar created

    Hi Hilal

    I know it's difficult for you to get into details right now but at least you can confirm to me that those entities could be implemented. Later on I'll will surely share my technical issues if any here on the forums.

    Any link to learn more about those events, how to handle them etc.

    Thank you Bilal

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can read more about ABP's domain events here <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/EventBus-Domain-Events">https://aspnetboilerplate.com/Pages/Doc ... ain-Events</a>.

    Basically, you need to define event handlers you want to catch, see <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/EventBus-Domain-Events#DocHandleBaseEvent">https://aspnetboilerplate.com/Pages/Doc ... eBaseEvent</a>. ABP will automatically call your handle's.

  • User Avatar
    0
    bilalhaidar created

    Given the illustration above to handle certain events is it okay to make use of those events to run my own code? For instance I need to create 4 roles or groups when an OU is created. Is there a better way or using events is better?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, events is very convinient for your case, you can do exactly what you want using domain events.

  • User Avatar
    0
    bilalhaidar created

    Thanks a lot Ismail!