ClassId: Integer;
ClassId: System.Int32;
The ClassId property returns object type identifier.
The property is read-only and is used by the methods IMetabaseSecurityClassesAttributes.Add, IMetabaseSecurityClassesAttributes.FindByClass, IMetabaseSecurityClassesAttributes.RemoveByClass.
An object type identifier is also contained in the MetabaseObjectClass enumeration.
To execute the example, make sure that attributes are contained for at least one object type.
Add links to the ABAC, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Attrs: IMetabaseSecurityObjectsAttributes;
ClassAttrs: IMetabaseSecurityClassAttributes;
Id: Integer;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Delete object type attributes
Attrs := MS.Policy.ObjectsAttributes;
ClassAttrs := Attrs.Classes.Item(0); // determine object type by index, for which there are attributes
Id := ClassAttrs.ClassId; // determine identifier of this object type
Attrs.Classes.RemoveByClass(Id);
// Save changes in security manager
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.ABAC;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Attrs: IMetabaseSecurityObjectsAttributes;
ClassAttrs: IMetabaseSecurityClassAttributes;
Id: Integer;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Delete object type attributes
Attrs := MS.Policy.ObjectsAttributes;
ClassAttrs := Attrs.Classes.Item[0]; // determine object type by index, for which there are attributes
Id := ClassAttrs.ClassId; // determine identifier of this object type
Attrs.Classes.RemoveByClass(Id);
// Save changes in security manager
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the object type attributes with the 0 index are deleted.
See also: