Permission.ApplyPolicy(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies a policy to the form using a policy template file.
public:
abstract void ApplyPolicy(System::String ^ filename);
public abstract void ApplyPolicy (string filename);
abstract member ApplyPolicy : string -> unit
Public MustOverride Sub ApplyPolicy (filename As String)
Parameters
- filename
- String
The path and file name of an Extensible Rights Markup Language (XRML) file that defines users and groups and permissions to apply to the form template.
Exceptions
The parameter passed to this method is a null reference (Nothing in Visual Basic).
The parameter passed to this method is not valid. For example, it is of the wrong type or format.
Examples
In the following example, clicking the Button control applies a policy template file that allows the user to edit, but not copy the current form.
public void CTRL1_Clicked(object sender, ClickedEventArgs e)
{
this.Permission.ApplyPolicy(
"\\\\MyShare\\Templates\\Edit_but_not_copy.xml");
}
Public Sub CTRL1_Clicked(ByVal sender As Object, _
Me.Permission.ApplyPolicy( _
"\\MyShare\Templates\Edit_but_not_copy.xml")
End Sub
Remarks
To view an example of the format of an XRML file that is used as a policy template file, see Sample End-User License
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.