Never use SelectServer/ISelectServer in Custom Order Rules

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

Never use SelectServer/ISelectServer in Custom Order Rules

Post by BobRichards »

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, Senior Software Developer, SoftPro
Post Reply