Security User Assign Issue
Posted: Wed May 18, 2016 6:27 pm
Guys,
I'm seeing an issue with trying to assign a user to a group. If I run the process and new manager has been added to a project it creates the group but does not assign the user. If I then run the process again (The group already exists) it still doesn't assign the user. Any idea what a) I'm doing wrong or b) what's the issue with my code. I took commitment issues out of it with the failure in the second run,
Jim.
I'm seeing an issue with trying to assign a user to a group. If I run the process and new manager has been added to a project it creates the group but does not assign the user. If I then run the process again (The group already exists) it still doesn't assign the user. Any idea what a) I'm doing wrong or b) what's the issue with my code. I took commitment issues out of it with the failure in the second run,
Jim.
Code: Select all
IF(vManager1Index<>0);
# Obtain the user name of the person being assigned
vManager1Name=Lower(DimNm(vManager1Dim,vManager1Index));
vManager1User=IF(DimIx(vUserDim,'Active Directory/'|vManager1Name)<>0
,'Active Directory/'|vManager1Name
,'Active Directory\'|vManager1Name
);
# Set what the name of the group will be for this user
vManager1Group=vManager1Name|'-GRP';
# Check to see if the name matches a valid user ID
IF(DimIx(vUserDim,vManager1User)<>0);
# Check to see if the group already exists and adds it if it doesn't
IF(DimIx(cSecGroupDim,vManager1Group)=0);
AddGroup(vManager1Group);
IF(iCounter=0);
vTextArray='<br>'|vManager1Group|'</br>';
Else;
vTextArray=vTextArray|'<br>'|vManager1Group|'</br>';
EndIF;
iCounter=iCounter+1;
EndIF;
# after checking the group assign the user
AssignClientToGroup(vManager1User,vManager1Group);
EndIF;
EndIF;