Apply(Options: AccessElementApplyOptions);
Options. It determines parameters of applying specified access permissions.
The Apply method saves the specified values of access attributes and applies these permissions according to the selected parameters.
Executing the example requires that the schema contains an MDM repository with the RDS identifier and an MDM dictionary with the DICT_1 identifier. 4 users or groups must exist in a list of access subjects for MDM dictionary.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Object: IMetabaseObjectDescriptor;
AOS: IAccessObjectSecurity;
Iterator: IAccessElementsIterator;
level: integer;
element: IAccessElement;
AttributeValue: IAccessAttributeValue;
Begin
MB := MetabaseClass.Active;
Object := MB.ItemByIdNamespace("DICT_1", MB.ItemById("RDS").Key);
AOS := Object.GetSecurity;
Iterator := AOS.GetElements;
Level := Iterator.Next;
element := Iterator.Current;
element := element.Edit;
AttributeValue := New AccessAttributeValue.Create(32, 12);
element.AttributeAccess(AccessElementAttributes.Read) := AttributeValue;
element.Apply(AccessElementApplyOptions.ByHierarhy Or AccessElementApplyOptions.ByLevel);
End Sub UserProc;
After executing the example access permissions on reading the first element, all its child elements and elements located on the same level with the first are changed. There is no access to these elements for the first two security subjects.
See also: