You are viewing limited content. For full access, please sign in.

Question

Question

SDK and NamedUserStatus

asked on October 31, 2018 Show version history

I'm currently struggling with a problem trying to extract whether or not a user is taking up a named user license. I am trying to work with the NamedUserStatus enumeration but no matter what I change in the Admin Console my program returns 'NONE' as the enumeration member.

0 0

Replies

replied on October 31, 2018 Show version history

Does this code work if you know the SecurityIdentifier for the user?

SecurityIdentifier sid = new SecurityIdentifier(userSidString);
UserInfo userInfo = (UserInfo)Account.GetInfo(sid, session);
NamedUserStatus nuStatus = userInfo.NamedUserStatus;

If not, can you post a code snippet showing how you are retrieving the NamedUserStatus property?

0 0
replied on November 1, 2018

Robert,

I'm working with Stan and what we're doing is:

 foreach (AccountInfo info in Account.EnumAll(currentSession) ) 
      {

           name = info.Name;

           TrusteeInfo information = info.GetTrusteeInfo();

.....

           writer.WriteLine("       " + name + "  " + information.NamedUserStatus);

       }

 

And what gets written is:

Username1     None

UserName2    None

...
Is this not equivolent? BTW, for example, UserName1 is defined as Full in the Admin Console.

Jim

0 0
replied on November 1, 2018

This looks like a bug in Account.EnumAll, it does not populate the named user status property. Try using the code I posted earlier to get the UserInfo, and use that object to get the NamedUserStatus.

0 0
replied on November 1, 2018

Robert,

I was able to add your code but I'm getting a cast exception between the System and Laserfiche namespaces.

How do you get your userSidString?

I'm looping through each repository, getting a connection then looping through each account and looking for NamedUserStatus on those accounts.

foreach (AccountInfo info in Account.EnumAll(currentSession)

string mySid = info.Sid.ToString();

SecurityIdentifier sid = new SecurityIdentifier(mySid);
UserInfo userInfo = (UserInfo)Account.GetInfo(sid, currentSession);
NamedUserStatus nuStatus = userInfo.NamedUserStatus;
 

Thanks for your help so far!

Jim

 

0 0
replied on November 1, 2018 Show version history

Pass info.Sid directly to Account.GetInfo:

foreach (AccountInfo info in Account.EnumAll(session))
{
    AccountInfo actInfo = Account.GetInfo(info.Sid, session);
    if (actInfo.TrusteeType == TrusteeType.LaserficheUser)
    {
        UserInfo userInfo = (UserInfo)actInfo;
        NamedUserStatus nuStatus = userInfo.NamedUserStatus;
    }
}

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.