So I tested several scenarios and I think I understand what is happening.
Basically what I wanted to understand is if a user changes roles in the organization can I just add him to a new role in AD and it update in OTRS... My initial test was not a good one.
Ex... OTRS Admin moves to Agent Role <they lose certain access>
For this scenario I just removed the user out of AD that made them OTRS Admins and was expecting them to lose all those rights. THAT DOES NOT WORK! --->
For a better test I created a No-Access Group (basically a blank role). I removed the OTRS Admins Role in AD and added the user to the No-Access Role in AD. After logging in it removed all access to the user in OTRS. IT WORKS!
Here is what I believe is happening. The code will not "update" the user role in OTRS unless there is a change to the "ADD" function of the script.
Function says .... since the user is not in any role in AD I will not run and continue to process like nothing has changed for the user. (when in fact it has changed)
IMHO. What it should say is....
Code: Select all
Check user access in AD
IF user is in linked group in config.pm THEN
Add User to linked role
ELSEIF User is not in linked group in config.pm
AND IF user is in linked roles in OTRS THEN
FOR EACH linked role in OTRS
Remove user
NEXT
ENDIF
I understand that some people may not want this to happen if they are running a hybrid role setup for example some people were manually added in OTRS and others were added to roles through AD. I would think that most people would not be doing this and at the very least it is bad practice.
So for now I believe this is a work around to what I wanted to do and I am wrong this is NOT a bug but would be a nice feature in upcoming releases if I can put a vote in to have it added.
Thanks for the replies as always forum is a big help.