IAccessElement.Apply

Syntax

Apply(Options: AccessElementApplyOptions);

Parameters

Options defines parameters of applying assigned access permissions.

Description

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

Example

Executing the example requires that the scheme contains an MDM repository with the MDM identifier and an MDM dictionary with the Dict_1 identifier. 4 users/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 this example access permissions on reading the first element, all its children 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