Add(Type: ExternalCatalogType; [Realm: String = ""]): IABACSubjectAttributesMapping;
Type. Type of external storage area/domain.
Realm. Name of external storage area/domain.
The Add method creates settings of a link between user attributes and attributes of external storage area/domain.
An attribute binding cannot be created for the platform internal storage with the ExternalCatalogType.Internal type.
The Realm parameter is used only with the ExternalCatalogType.LDAP type to specify the subdomain, to which attribute link settings are applied. If the name is not specified, the settings are applied to all domains.
To execute the example in the security manager, users should have attributes with the EMAIL, ACCESS identifiers. The network should have the SUBDOMAIN subdomain.
Add links to the ABAC, Host, and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
ABACAttributes: IABACSubjectAttributes;
Mappings: IABACSubjectAttributesMappings;
Mapping: IABACSubjectAttributesMapping;
Map: IABACSubjectAttributeMapping;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
// User attributes
ABACAttributes := MS.Users.Attributes As IABACSubjectAttributes;
Mappings := ABACAttributes.Mappings;
// Create and set attribute link settings
Mapping := Mappings.Add(ExternalCatalogType.LDAP, "SUBDOMAIN");
Map := Mapping.Add(ABACAttributes.FindById("EMAIL"));
Map.ExternalName := "EMAIL2";
Mapping := Mappings.Add(ExternalCatalogType.ExtService);
Map := Mapping.Add(ABACAttributes.FindById("ACCESS"));
Map.ExternalName := "USER_ACCESS";
// Apply changes
MS.Apply;
End Sub UserProc;
When executing the example, new links are added between user attributes and attributes of external storage area and subdomain.
See also: