14.3. Understanding InfoPath Security

There are three basic scenarios that a form template must support.

First, you need a way to simply gather data without any special programming or logic. You just want to present a simple dialog to users and let them fill in the fields you have declared in the form schema. Then you want to work with the data they have entered.

In the second scenario, you want to make the form more intelligent and dynamically control what data the user can enter. For example, you might have a list of departments in a SharePoint list, and you want to let the user choose a department name from a dropdown list in the form. For that, you need to put some code in the form to retrieve the list of departments from SharePoint and display them to the user, and so on.

In the third scenario, you need to add more sophisticated logic to the form. For instance, you might need to invoke some supporting code to validate the data, or you may want to include special programming for submitting the form data. These kinds of situations require writing managed code that is attached to the form and is executed on each machine where the form is installed.

Each of these scenarios maps broadly to one of three security modes that InfoPath recognizes. They are, respectively, restricted mode, domain security mode, and full trust security mode.

14.3.1. Restricted Security Mode

Consider the case where you only need to retrieve some data fields from the user. One way to do that might be to ...

Get Professional SharePoint® 2007 Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.