locked
SecurityPrincipals --> get users RRS feed

  • Question

  • Hello

    I try to get the users list for my mds DB

    principals returns 0 users.

    what is missing please ? is it the right method ?

     SecurityPrincipalsCriteria spc = new SecurityPrincipalsCriteria();
            
            spc.SecurityResolutionType = SecurityResolutionType.Users;
            spc.Identifiers = new Collection<Identifier>();
            spc.Type = PrincipalType.UserAccount;
            spc.ResultType = ResultType.Details;
            spc.ModelPrivilege = ResultType.Details;
            spc.FunctionPrivilege = ResultType.Details;
            SecurityPrincipals principals;
            Common.MDS_WS.or = Common.MDS_WS.c.SecurityPrincipalsGet(Common.MDS_WS.intl, spc, out principals);
          
    
    thanks
    

    Xavier Averbouch
    Tuesday, August 17, 2010 12:46 PM

Answers

  • Hi again,

    I found a solution:  
    //security users
                SecurityPrincipalsCriteria spc = new SecurityPrincipalsCriteria();
                spc.All = true;
                spc.SecurityResolutionType = SecurityResolutionType.Effective;
                spc.Identifiers = new Collection<Identifier>();
                spc.Type = PrincipalType.UserAccount;
                spc.ResultType = ResultType.Details;
                spc.ModelPrivilege = ResultType.Details;
                spc.FunctionPrivilege = ResultType.Details;
                SecurityPrincipals principals;

                using (MDS_WS.c = mds.CreateMdsProxy())
                {
                    OperationResult or = Common.MDS_WS.c.SecurityPrincipalsGet(Common.MDS_WS.intl, spc, out principals);
                }
                lstUsers.Items.Clear();
                foreach (User user in principals.Users)
                {
                    lstUsers.Items.Add(user.DisplayName);
                }

    Xavier Averbouch
    Tuesday, August 17, 2010 4:09 PM