StrataFrame Security Documentation Send comments on this topic.
Field-Level Security Keys

Glossary Item Box

Field-Level Security Keys

The security keys assigned to fields within a business object are stored within a shared dictionary that is declared within the partial class for each business object type. This allows the collection of keys to be shared across business object instances that are the same type.

Assigning Field-Level Keys using the BOMapper

The Business Object Mapper is used to assign security keys to fields within a business object.

To assign a security key to a field:

  1. Open the Visual Studio solution for your application.
  2. Select Business Object Mapper from the StrataFrame menu.
  3. All created business objects will be available in the left panel under their associated project.  Select the desired business object from the available options.
  4. The fields for the selected business object will become available in the right panel.  Select the desired field from the available options.
  5. Edit the Custom Field Properties by right-clicking on the field and selecting Customize Field... from the context menu
    OR
    Clicking the Customize Field command button.
  6. The security key is entered in the Security Key text box.  Type the security key in the Security Key textboxo
    OR
    Click the browse (...) button to bring up the Security Key Type Editor to browse for the security key.
  7. Click OK to confirm the changes.

Note: More information on editing custom field properties within the Business Object Mapper can be found in the Business Layer section of the StrataFrame help file.

Assigning Security Keys Programmatically

The recommended method of assigning security keys programmatically is to override the GetCustomBindablePropertyDescriptors() method within a business object to return a collection of property descriptors that describe the custom properties that belong to the business object. This method is only called once per business object type, so it is the most logical place to programmatically set the security keys for fields within the business object.

Note: Programmatically setting the security keys for properties is normally only required when you create a custom property and need to set the security key for that custom property. Since you will need to use the GetCustomBindablePropertyDescriptors() method to return the property descriptor for the custom property, it is logical to also set the security key for the custom property within this method.

Sample - Setting the Security Key on a Custom Property Programmatically [Visual Basic]
Imports MicroFour.StrataFrame.Business
...
Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()
    '-- Set the security key for the custom field property
    _FieldPermissionKeys.Add("MyCustomField", "MySecurityKey")

    '-- Return the property descriptor for the custom field
    Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor( _
        "MyCustomField", Me.GetType())}
End Function

Sample - Setting the Security Key on a Custom Property Programmatically [C#]
using MicroFour.StrataFrame.Business;
...
protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
    //-- Set the security key for the custom field property
    _FieldPermissionKeys.Add("MyCustomField", "MySecurityKey");

    //-- Return the property descriptor for the custom field
    return new FieldPropertyDescriptor[] {new ReflectionPropertyDescriptor( 
        "MyCustomField", Me.GetType())};
}