SID from USERID

andy76andy76 Member Posts: 616
Hello,

is there a good method, function to have the SID from USERID actually connected to NAV?

USERID doesn't contain the "domain\" string but only the username....

Thank you very much

Comments

  • Big_DBig_D Member Posts: 207
    Hi Andy76

    You referring to the lookup on the UserID in the User Setup form - where you can connect Nav Logins and Window Logins?

    With thanks
    Big D signing off!
  • krikikriki Member, Moderator Posts: 9,110
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ReinhardReinhard Member Posts: 249
    One other piece of info that may help you:

    The User SID virtual table contains the user's SID.
    Important/potentially useful: It contains all of their SIDs. Which means if they are part of windows groups etc. (which might also have Nav permissions) you would have to do
    IF "User SID".FINDFIRST THEN
    REPEAT
     ...
    UNTIL "User SID".NEXT = 0;
    

    so that should help understand what Kriki's code is doing.
  • krikikriki Member, Moderator Posts: 9,110
    Small correction: Do NOT use FINDFIRST if you use REPEAT-UNTIL. So:
    IF "User SID".FINDSET THEN
    REPEAT
    ...
    UNTIL "User SID".NEXT = 0;
    

    BTW: important to remember about that table is that it only gives the SID's of CURRENT user. So if you want to know all the SID's of a user, you need to create a form/page/report/... on that table and then run it with the users credentials.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.