[This is preliminary documentation and subject to change.]
Loads an authorization policy from a XML file.
A reference to an AuthorizationPolicy class populated from the data in the xmlFileName.
The CurrentState is preserved while loading / saving authorizaton models. However, the CurrentPrincipal is not saved.
CAUTION Because the XML file doesn't store the current principal, before using the AuthorizationPolicy instance be sure to specify feasible CurrentPrincipal reference to be used to resolve role membership.
The following example loads an authorization policy from a file and prepares the authorization context by setting the CurrentPrincipal property to an instance of the ExtendedPrincipal class.
[Visual Basic]
Dim policy As AuthorizationPolicy = AuthorizationPolicyLoader.LoadFromFile("c:\model.xml")
policy.CurrentPrincipal = New ExtendedPrincipal
[C#]
AuthorizationPolicy policy = AuthorizationPolicyLoader.LoadFromFile(@"c:\model.xml");;
policy.CurrentPrincipal = new ExtendedPrincipal();
AuthorizationPolicyLoader Class | LaMarvin.Constable Namespace