Hello everybody.
I’m working with MODx for the first time now and I have a doubt.
I’m developing a system where some users have more privileges than others. My problem is that I need a role where the user can create new users, but the user who is creating the new user can set only the roles under his role. Is it possible in MODx? Or can I force the user created to have an specific role?
Sorry if I was confusing.
I’m waiting for answers, thanks.
Ed
You can’t restrict what roles the user can assign. I think that you may be able to set the role using a plug-in where you would check the user role assigned the the current user and when they create a new user to select a predetermined role.
I think that the OnUserFormRender event will let you set the user before the page renders and OnBeforeUserFormSave will let you set it before it is saved but after it is filled in.
Actually, you could have a plug-in only ’load’ determined options for the roles as well. In any case a plug-in is what you need to look into.
Hello, first of all, thank you by the answer.
Do you know some plug-in that does this kind of work? It really would be useful.
Thanks again.
When you say ’users’ do you mean ’Web Users’ or ’Manager Users’? If they are ’Manager Users’ - a module would probably be better than a plugin.
In either case, anyone familiar with writing code for Modx could come up with a solution. The nice thing about Modx is how easy it is to write custom code.
Of course the main concern would be security. Granting permission to add users should not be taken lightly.