Constable Authorization Engine 2.0 BETA

AuthorizationPolicyLoader.LoadFromXml Method (String)

[This is preliminary documentation and subject to change.]

Loads an instance of the AuthorizationPolicy class from the given XML string.

[Visual Basic]
Overloads Public Shared Function LoadFromXml( _
   ByVal xml As String _
) As AuthorizationPolicy
[C#]
public static AuthorizationPolicy LoadFromXml(
   string xml
);

Parameters

xml
The XML string containing the definition of a valid authorization policy.

Return Value

An instance of the AuthorizationPolicy class initialized according to the data found in the XML string.

Remarks

The XML string must contain well-formed XML starting with the <authorizationPolicy> element.

See the GetXml method to see how you can get a XML string representing an AuthorizationPolicy instance.

CAUTION After loading the model, be sure to set the CurrentPrincipal property because it is not preserved while saving and loading XML files.

Example

The following example loads the document approval authorization policy defined in the _doc.xml file.

[Visual Basic]
Dim docAuthorizationPolicy As AuthorizationPolicy = AuthorizationPolicyLoader.LoadFromXml("_doc.xml")

[C#]
AuthorizationPolicy docAuthorizationPolicy = AuthorizationPolicyLoader.LoadFromXml(@"_doc.xml");

See Also

AuthorizationPolicyLoader Class | LaMarvin.Constable Namespace | AuthorizationPolicyLoader.LoadFromXml Overload List | AuthorizationPolicy