Classes: IMetabaseSecurityClassesAttributes;
The Classes property returns object type parameters.
This property is relevant on adding a new attribute for a particular object type.
Object types are determined using the IMetabaseSecurityClassesAttributes.Add method by two ways:
As the MetabaseObjectClass enumeration, for example:
Classes.Add(MetabaseObjectClass.KE_CLASS_STDDIM);
As a value, for example:
Classes.Add(1025).
To execute the example, add links to the ABAC, Metabase, and Dal system assemblies.
Sub UserProc;
Var
ABACAttribute: IABACAttribute;
ABACAttributes: IABACAttributes;
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Attrs: IMetabaseSecurityObjectsAttributes;
ClassAttrs: IMetabaseSecurityClassAttributes;
Begin
MB := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Add an attribute for the Table Dictionary object type
Attrs := MS.Policy.ObjectsAttributes;
ClassAttrs := Attrs.Classes.Add(1025);
ABACAttribute := ClassAttrs.Attributes.Add;
ABACAttribute.Name(MB.CurrentLocale) := "Object type";
ABACAttribute.Id := "Dictionary";
ABACAttribute.Description(MB.CurrentLocale) := "For table dictionaries";
ABACAttribute.DefaultValue := 20;
ABACAttribute.DataType := DbDataType.Integer;
// Add an attribute for object classes
Attrs := MetabaseClass.Active.Security.Policy.ObjectsAttributes;
ABACAttribute := Attrs.Global.Add;
ABACAttribute.Name(MB.CurrentLocale) := "Object classes";
ABACAttribute.Id := "Object";
ABACAttribute.Description(MB.CurrentLocale) := "For object classes";
ABACAttribute.DefaultValue := 15;
ABACAttribute.DataType := DbDataType.Integer;
// Save changes in security manager
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the attributes for object class and the particular object type that is Table Dictionary are added in the security manager.
See also: