HasWriteAccess: Boolean;
The HasWriteAccess property returns whether a current user has permissions to change elements values by this attribute.
Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.
Sub Main;
Var
MB: IMetabase;
Dict: IRdsDictionary;
DictInst: IRdsDictionaryInstance;
AttrsInst: IRdsAttributesInstance;
AttrInst: IRdsAttributeInstance;
i: Integer;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("DICT_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
DictInst := Dict.Open(Null) As IRdsDictionaryInstance;
AttrsInst := DictInst.Attributes;
For i := 0 To AttrsInst.Count - 1 Do
AttrInst := AttrsInst.Item(i);
Debug.Write(Attribute: + AttrInst.Name);
If AttrInst.HasReadAccess Then
Debug.Write(; Available access on reading);
Else
Debug.Write(; Unavailable access on reading);
End If;
If AttrInst.HasWriteAccess Then
Debug.Write(; Available access on writing;);
Else
Debug.Write(; Unavailable access on writing;);
End If;
Debug.WriteLine("");
End For;
End Sub Main;
After executing the example a list of attributes available in the MDM dictionary is displayed in development environment console. Availability of permissions on reading and writing is specified for each attribute.
See also: