EditRequiresAdditionalLicense: String;
EditRequiresAdditionalLicense: string;
The EditRequiresAdditionalLicense property determines a name of application feature to protect repository objects from editing.
Editing protection is available for the following repository objects: resources, assembly, form, unit, .NET assembly, .NET form, .NET unit.
The property is set to Null by default. If a property value is set, it is additionally checked on repository object editing if there is an application feature with corresponding name.
To view available features, use license manager, the About window or the ILicenseManager.GetAllFeatures method.
Features of property use:
When changing property value, check if there is the current application feature before the change and the application feature to be set.
Application feature name must differ from names of existing features.
An application feature is requested and generated separately.
To set up repository objects protection from editing, also use the Objects Protection from Editing dialog box.
To work with application features, see the Protecting Application Systems article.
Executing the example requires a form with the following components:
Button. A button named Button1 to get application feature name and a button named Button2 to protect repository objects from editing.
EditBox. A component named EditBox1 to enter object identifier and a component named EditBox2 to enter/display application feature name. In the Fore.NET example use the TextBox components named textBox1 and textBox2.
Add links to the Metabase, Forms system assemblies.
The example is a handler of the OnClick event for the Button1 and Button2 components.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Begin
Mb := MetabaseClass.Active;
Obj := Mb.ItemById(EditBox1.Text);
EditBox2.Text := Obj.Bind.EditRequiresAdditionalLicense;
End Sub Button1OnClick;
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Lic: IMetabaseObject;
Begin
Mb := MetabaseClass.Active;
Obj := Mb.ItemById(EditBox1.Text);
Lic := Obj.Edit;
Lic.EditRequiresAdditionalLicense := EditBox2.Text;
Lic.Save;
End Sub Button2OnClick;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Forms.Net;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Begin
Mb := Self.Metabase;
Obj := Mb.ItemById[textBox1.Text];
textBox2.Text := Obj.Bind().EditRequiresAdditionalLicense;
End Sub;
Private Sub button2_Click(sender: System.Object; e: System.EventArgs);
Var
Mb: IMetabase;
Obj: IMetabaseObjectDescriptor;
Lic: IMetabaseObject;
Begin
Mb := Self.Metabase;
Obj := Mb.ItemById[textBox1.Text];
Lic := Obj.Edit();
Lic.EditRequiresAdditionalLicense := textBox2.Text;
Lic.Save();
End Sub;
After executing the example enter repository object identifier in the EditBox1 component and click the Button1 button. An application feature name is obtained and is displayed in the EditBox2 component if the object is protected from editing. If the object is protected from editing with an application feature, to enable protection enter application feature name in the EditBox2 component and click the Button2 button. The specified repository object will be protected from editing with the application feature.
See also: