IAccessElement.Apply

Syntax

Apply(Options: AccessElementApplyOptions);

Parameters

Options determines parameters of applying specified access permissions.

Description

The Apply method saves the specified values of access attributes and applies these permissions according to the selected parameters.

Example

Executing the example requires that the schema contains an MDM repository with the MDM 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.

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:

IAccessElement