Save(Writer: IXmlDomElement);
The Save method saves attribute-based access control structure to XML file.
To load saved attribute-based access control structure from XML file, use the IABACRootPolicyObject.Load method.
To execute the example, make sure that attribute-based access control contains element structure: policies set, policies, rules.
Add links to the ABAC, Metabase, and Xml system assemblies.
Sub UserProc;
Var
PolicyObject: IABACRootPolicyObject;
MB: IMetabase;
MS: IMetabaseSecurity;
Xml: IXmlDomElement;
XmlDoc: IXmlDomDocument;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
// Get attribute-based access control
PolicyObject := MS.Policy.ABACRules;
// Save attribute-based access control to XML file
XmlDoc := New DOMDocument.Create;
Xml := XmlDoc.createElement("ABAC");
XmlDoc.appendChild(Xml);
PolicyObject.Save(Xml);
XmlDoc.save("C:\temp\ABAC.xml");
End Sub UserProc;
After executing the example the specified XML file contains attribute-based access control structure.
See also: