Page 1 of 1

Never use SelectServer/ISelectServer in Custom Order Rules

Posted: Mon Aug 31, 2015 4:16 pm
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)