Never use SelectServer/ISelectServer in Custom Order Rules

Discussions related to custom development with Select.
Post Reply
BobRichards
Posts: 982
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Never use SelectServer/ISelectServer in Custom Order Rules

Post by BobRichards » Mon Aug 31, 2015 4:16 pm

SelectServer and ISelectServer objects must never be used in Custom Order Rules since these interfaces are not always available when the rule can run. Probably the only reason you might be tempted to do this is to get the current user. You should get it this way:

Code: Select all

	# Get the ISecurityUser object for the current user.
	secMgr = args.GetService(ISecurityManager)
	user = ISecurityManager.CurrentSecurityIdentityID.GetValue(secMgr)
	secID = ISecurityManager.GetUser(secMgr, user)
Bob Richards, Software Developer, SoftPro

Post Reply