SecurityController may only be set if it is currently null and SecurityController.HasGlobal() is false. Otherwise a SecurityException is thrown.
public void SetSecurityController(SecurityController controller) { if (@sealed) { OnSealedMutation(); } if (controller == null) { throw new ArgumentException(); } if (securityController != null) { throw new SecurityException("Can not overwrite existing SecurityController object"); } if (SecurityController.HasGlobal()) { throw new SecurityException("Can not overwrite existing global SecurityController object"); } securityController = controller; }