mibuso.com

Microsoft Business Solutions online community
It is currently Thu Jun 20, 2013 3:26 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SID from USERID
PostPosted: Thu Mar 22, 2012 7:05 pm 
Offline

Joined: Thu Sep 07, 2006 11:58 am
Posts: 471
Location: Mendrisio
Country: Switzerland (ch)
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


Top
 Profile  
 
 Post subject: Re: SID from USERID
PostPosted: Thu Mar 22, 2012 7:18 pm 
Offline

Joined: Wed May 16, 2007 6:35 pm
Posts: 111
Location: Ellesmere Port
Country: United Kingdom (uk)
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!


Top
 Profile  
 
 Post subject: Re: SID from USERID
PostPosted: Thu Mar 22, 2012 10:31 pm 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7526
Location: Milan
Country: Italy (it)
Try this:

[url]recUserSID.RESET;
recUserSID.SETFILTER(ID,'*\' + USERID);
recUserSID.FINDFIRST;
MESSAGE('%1',recUserSID.SID);[/url]

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject: Re: SID from USERID
PostPosted: Fri Mar 23, 2012 3:03 am 
Offline

Joined: Sat Mar 29, 2008 1:19 am
Posts: 206
Location: California
Country: United States (us)
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
Code: Select all
IF "User SID".FINDFIRST THEN
REPEAT
...
UNTIL "User SID".NEXT = 0;


so that should help understand what Kriki's code is doing.

_________________
Oztera


Top
 Profile  
 
 Post subject: Re: SID from USERID
PostPosted: Fri Mar 23, 2012 11:08 am 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7526
Location: Milan
Country: Italy (it)
Small correction: Do NOT use FINDFIRST if you use REPEAT-UNTIL. So:
Code: Select all
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
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot], pitt95 and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: