I’m working on a project that will essentially allow a supervisor the ability to create a new user… without giving the supervisor admin rights.
I have a module of “create agent” and I have a before_save logic hook on that module. It checks to see if a user exists with that information, if not then it creates the user: This part works. Now I’m needing to extend that to assign that new user to an existing role, and to eventually create a group between the supervisor and new user… IE - Supervisor will be in a group with each of the agents individually, so they can see all of their agents, but agent won’t see other agent kind of things…
Currently - I’m stuck trying to link it to a role. I’ve tried load_relationships but can’t get a relationship between users/roles from it and vardef files aren’t giving me a link name to work with there. I have pulled the Role ID that I want to link to, so I can at least get that. Suggestions? Further on, as agent progresses, they get added to different roles to see the next training section as well.
Also - if my approached use of groups isn’t the best option for access control - suggestions would be awesome there too! Think like Each owner has x Managers and each Manager has x leads and each lead has x team members. Need to see everything downstream only.
Thank you!