Base solution for your next web application
Open Closed

Create Tenant Specific Menu #10044


User avatar
0
huntethan89 created

Hi, I want to create tenant specific menu (Left side Menu). I am using edit "Roles" feature to add/remove menu items, this is working fine for normal users under any Tenancy but admin of every Tenancy is still able to view all menu items.

My Requirement:

  1. Host have different menu.
  2. Tenant admin/normal users have different mentu.

5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @smartlayer

    You can create different Roles for Tenant users and admin and assign necessary permissions to those Roles. Also, you can assign specific permissions to each user if necessary.

    Does that work for you ?

  • User Avatar
    0
    huntethan89 created

    Issue is when we create a new tenant a default user is also created whose role is admin. So Whatever permissions we have applied to host(admin) role are automatically applied to tenant user (admin role). That's why same menu is appearing for Host admin and Tenant admin. Is there any way we can create a new role let's say "TenantAdmin" and whenever we create a new tenant role "TenantAdmin" is applied to default user?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    When a new Tenant is created, admin role is assigned to admin user of that Tenant here. So, you can define a new role and assign it here for the newly created Tenant admin insted of admin role.

  • User Avatar
    0
    huntethan89 created

    Hi @ismcagdas,

    I have achived this using "StaticRoles" feature:

    roleManagementConfig.StaticRoles.Add(
                    new StaticRoleDefinition(
                        StaticRoleNames.Tenants.Tenant_Admin,
                        MultiTenancySides.Tenant)
                    {
                        GrantedPermissions =
                        {
                        AppPermissions.Pages_Administration,
                        AppPermissions.Pages_Administration_Roles,
                        AppPermissions.Pages_Administration_Roles_Edit
                        }
                    }
                    );
    

    My question is this will apply permissions to newly created Tenant, But how we will add/Remove permissions to all existing tenants? Is there any feature available?

    I have found something regarding this: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4528#issuecomment-510102409 is this ok?

    Or can you guide me how to achieve this.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @smartlayer

    You are right, existing tenants will not be updated. You need to update existing tenants manually.