Hi team, I need to build a customer-facing Admin P...
# ask-a-descoper
s
Hi team, I need to build a customer-facing Admin Portal where our users can manage their own team members. The Requirement: I need to enforce strict Delegated Administration rules with distinct branches. Users should only be able to assign specific roles based on their own role. The Scenario: • Role A (Super Admin) can assign Role B (Sales Manager) and Role C (Tech Lead). • Role B (Sales Manager) can only assign Role D (Sales Rep). • Role C (Tech Lead) can only assign Role E (Developer). • The Constraint: Role B must NOT be able to assign Role E (even though they are both lower in the hierarchy). My Questions: 1. Does Descope have a native configuration to define these specific "Role Assignment" constraints? 2. Can the standard User Management Widget handle this logic automatically (filtering the role dropdown so the Sales Manager only sees "Sales Rep")? Or does this require building a custom UI?
g
Hi Shaumik. The logic of the user management widget for tenant admins will allow users to assign tenant admins to assign roles to users in their tenants. However, I'm not sure the built in widget can support all the logic you described. Typically the system looks on the user permissions to ensure a they can grant it. However at least the 4th line in your list is not something it can do today. So in general you can implement this logic on your side, and work with management SDK to implement the backend, but the widget might not provide you such granularity out of the box.
👍 1
@Doron Sharon please keep me honest here.
@Shaumik Mondal we discussed it internally, and it seems there is a path to us our built in widget and support the complex logic you are after. you can do that with creating artificial "control" permissions. The logic of assignment in the user management is designed to allow users to grant roles ONLY if they have all the permissions of the target role. So if user A has role B with permissions that include all permissions in Role C, the user will be able to assign this role to other users. And if not - than no. So in your example, you can create the permissions in roles that will allow only specific roles to grant like this:
Role A - xxx, yyy, permissionB. permissionC, permissionD, permissionE
Role B - permissionB, permissionD
Role C - permissionC, permissionE
Role D - permissionD
Role E - permissionE
As you can see Role D won't be able to assign Role E because it is missing permissionE, but Roel A will be... And so forth... This means you can actually use our widget OOTB... Hope this helps. Let us know if you have any further questions.
s
Oh I see. Thank you I'll try this.
👍 1