Need help for user management

Hi, I have question on user management.
I have 5 difference roles, Administrator, Manager, Supervisor, Operator and Guest.
I wish to only allow the Administrator and Manager to be able to Add or Modify the user.
My question is are there any way to not allow the Manager role to Add a new user with Administrator role ? i.e hide the Administrator role selection when i am logged in as Manager ?

Below is the expression i use to enable the User Management

if ({[System]Client/User/RolesString}= “Administrator” || {[System]Client/User/RolesString}= “Manager”,1,0)

Photo below showing that I am logged in as Manager but I can Add new user with Administrator.

Thanks and hope someone can help me on this.

A user can have multiple roles, so an equals comparison isn’t suitable. Consider using the hasRole() expression function instead.

Everything is possible with Custom Methods. I remember I did this for a project a while ago. I think the name of the methods is filterRols

This sounds like you mean extension functions?

yeah that, haha

the highest role i am assigning to my customer is Manager. but the problem is when I allow them to add new User, they can add a new user with Administrator role…which I want to prevent

@jespinmartin1 already answered this. You can use the filterRole extension function on the User Management component to filter out (hide) specific roles. E.g.

1 Like