Security User Assign Issue

Post Reply
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Security User Assign Issue

Post by jim wood »

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.

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;
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Security User Assign Issue

Post by jim wood »

We're set to security mode 5 and these are local groups. The users are coming in through CAM. For some reason we have active directory users with either a \ or a /, hence the check in my code,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
User avatar
gtonkin
MVP
Posts: 1265
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Security User Assign Issue

Post by gtonkin »

HI Jim,
Had an issue recently with a process trying to do a similar thing i.e. add a group if did not exist and add the user to it in one process.
I ended up placing the

Code: Select all

AssignClientToGroup(vManager1User,vManager1Group);
in the epilog and triggering based on a flag.
Don't think you are doing anything wrong may just be a glitch that has crept in - my system where this happened is 10.2.2 FP4
BR, George.

Learn something new: MDX Views
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Security User Assign Issue

Post by jim wood »

gtonkin wrote:HI Jim,
Had an issue recently with a process trying to do a similar thing i.e. add a group if did not exist and add the user to it in one process.
I ended up placing the

Code: Select all

AssignClientToGroup(vManager1User,vManager1Group);
in the epilog and triggering based on a flag.
Don't think you are doing anything wrong may just be a glitch that has crept in - my system where this happened is 10.2.2 FP4
Excellent shout my friend. I'll give it a try. We're on 10.1.1 so it may be something that crept in with version 10. I'll let you know how it goes,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
ardi
Community Contributor
Posts: 165
Joined: Tue Apr 02, 2013 1:41 pm
OLAP Product: tm1, cognos bi
Version: from TM1 9.4 to PA 2.0.9.6
Excel Version: 2010
Location: Toronto, ON

Re: Security User Assign Issue

Post by ardi »

AssignClientToGroup works only on Data Tab or Epilog Tab
Ardian Alikaj
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Security User Assign Issue

Post by jim wood »

ardi wrote:AssignClientToGroup works only on Data Tab or Epilog Tab
I do indeed have it within the metadata tab which explains why it's not working. I had to to originally do it this way as I have element assignments happening in the data tab. I have as suggested moved the user assignment to the epilog so we should be good. Thanks for your input guys.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Post Reply