Using VendorAccess

PreviousNext

Restricting end user access to vendor definitions

(c) 2011 Hermetech International Ltd.

You define the user's access to different vendor manipulation functions before you call a particular dialog. For instance, consider this scenario:

 

You have developed a system using the EasyHL7MC40 objects which relies on specific HL7 Vendor definitions which you have customized and subsequently ship with your system. You want to allow end users at the client site to have access to some of the features in the UserInterfaces but you don't want to run the risk of an end user inadvertently deleting or modifying your custom vendor definition(s). At the same time, you want to make sure that YOU or your support team CAN have full access to the UserInterfaces should you need to do on-site or remote support.

 

The Answer lies in the VendorAccess Property of the UserInterfaces object. This property is a new class object called TWHL7VendorAccessLevel.

 

Namespace: EasyHL7MC40_UI

Object Name: TWHL7VendorAccessLevel

Constructor: Accessed through the VendorAccess property of the UserInterfaces Class

Declaration: Private MyHL7UI As EasyHL7MC40_UI.UserInterfaces

Creation: MyHL7UI = New EasyHL7MC40_UI.UserInterfaces(MyVendorObject)

Usage: With MyHL7UI.VendorAccess

 

From the Example Application

From the Example Application

 

 

 

Properties

 

Name: AllowCreate

Data Type: Boolean (Read Write)

Description: User may create new vendor definitions

Name: Password

Data Type: String (Read Write)

Description: If set the user must enter a matching value to gain access to edit vendor objects.

Name: AllowDelete

Data Type: Boolean (Read Write)

Description: User may delete vendor definitions

Name: PasswordAttempts

Data Type: Integer (Read Write)

Description: The number of attempts the user made to enter the password

Name: AllowEditAnnotationsOnly

Data Type: Boolean (Read Write)

Description: User may edit ONLY the annotations properties of Vendor objects

Name: UserEnteredPassword

Data Type: String (Read Write)

Description: After a user exits from the Vendor Manager this property will contain  the last value the user entered into the password request.

Name: AllowEditFull

Data Type: Boolean (Read Write)

Description: User has full edit rights to all vendor objects

Name: VendorEditingEnabled

Data Type: Boolean (Read Write)

Description: User has access to edit HL7 Vendor Properties.

Name: AllowExport

Data Type: Boolean (Read Write)

Description: User may export vendor definitions from the Vendor Manager

Name: VendorManagementEnabled

Data Type: Boolean (Read Write)

Description: User has access to the Vendor Manager.

Name: AllowImport

Data Type: Boolean (Read Write)

Description: User may import vendor definitions from the Vendor Manager

Name: VendorReportingEnabled

Data Type: Boolean (Read Write)

Description: User has access to the Vendor Reports.

Name: AllowVendorPathChange

Data Type: Boolean (Read Write)

Description: User may select a new VendorPath in those dialogs which allow it.

 

 

Methods

 

Name: DenyAllVendorAccess

Returns: Boolean

Description: Quick shortcut method to set all of the boolean access properties to the  LOWEST level of user access.

Name: GrantReadOnlyVendorAccess

Returns: Boolean

Description: Quick shortcut method to set all of the boolean access properties so  that users have readonly access.

Name: GrantAllVendorAccess

Returns: Boolean

Description: Quick shortcut method to set all of the boolean access properties to the highest level of user access.

 

 

 

Example Code Scenario 1:

In these examples MyVendorObject is a fully instantiated HL7Vendor object

which has a Vendor definition opened (see the OpenVendor method).

See Programming with the HL7Vendor Object for more information.

 

    Dim obUI As New EasyHL7MC40_UI.UserInterfaces(MyVendorObject)

 

    With obUI

      'I want to grant the user full access to everything BUT

      'my program relies on the HL7Vendors being in a 

      'pre-defined location so I don't want the user to change it.

       'Step 1: Give them Full Access

      .VendorAccess.GrantAllVendorAccess()

       'Step 2: Take away the rights to change the vendor path

      .VendorAccess.AllowVendorPathChange = False

      .ProductName = "My HL7 Application"

      .WebSite = "www.hermetechnz.com"

      .ShowVendorManager()

       If .UpdatesWereMade Then 

        MessageBox.Show("You changed something!")

       End If   

    End With

 

Example Code Scenario 2:

 

    Dim obUI As New EasyHL7MC40_UI.UserInterfaces(MyVendorObject)

 

    With obUI

      'I want to grant the user full access to everything BUT

      'only those users who know the password. Also my vendors 

      'are installed in a pre-defined location so I don't want 

      'the user to change it.

       'Step 1: Give them Full Access

      .VendorAccess.GrantAllVendorAccess()

       'Step 2: Take away the rights to change the vendor path

      .VendorAccess.AllowVendorPathChange = False

       'Step 3: Set a password in the object

      .VendorAccess.Password = "Password123"

      .ProductName = "My HL7 Application"

      .WebSite = "www.hermetechnz.com"

      .ShowVendorManager()

       If .VendorAccess.UserEnteredPassword.ToUpper <> .VendorAccess.Password.ToUpper Then

          Messagebox.Show("You DID NOT KNOW the Password!")

       End If

    End With