RequestAdminCredentials: Boolean;
The RequestAdminCredentials property determines whether user credentials are requested if the current user does not have sufficient permissions to install update.
The property is set to False by default. In this case when the user does not have permissions to insert data to tables, the user credentials request is not displayed and the error is generated. When the value is True, the credentials of a user who has permissions to create tables and insert data in the corresponding database, are requested.
The setting is relevant only for inserting data to tables.
Executing the example requires that the repository contains a table with the Table_1 identifier. Add a link to the Metabase system assembly.
Sub UserProc;
Var
Mb: IMetabase;
MBDesc: IMetabaseObjectDescriptor;
MUpdate: IMetabaseUpdate;
ObjNode: IMetabaseUpdateDataObjectNode;
Begin
Mb := MetabaseClass.Active;
MBDesc := MB.ItemById("Table_1");
MUpdate := MB.CreateUpdate;
ObjNode := MUpdate.RootFolder.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
ObjNode.Label := MBDesc.Id;
ObjNode.Method := MetabaseUpdateMethod.All;
ObjNode.Object := MBDesc;
ObjNode.BatchMode := ObjectUpdateDataBatchMode.UpdateInsert;
ObjNode.RequestAdminCredentials := True;
MUpdate.SaveToFileNF("c:\Update.pefx");
End Sub UserProc;
After executing the example an update file is created. When installing this update in case of the absence of permissions to execute the operation, the credentials request is displayed.
See also: