One moment please...
 
 
Exact Synergy Enterprise   
 

SDK - How-to: Activating solutions for certain roles

Introduction

From product update 244 onwards, the license roles have been introduced where the number of roles that can be assigned to a user is based on the license. Details of the functionality tied to each of the roles will not be explained in this document. However, this document will describe how you can enable a page or functionality for a certain license role in your customization.

This document describes the following topics:

 

Configuring license roles on custom pages

The following roles are available as license roles:

  • CRM
  • Employee self-service
  • Enabling add-on solutions
  • Hour Entry
  • Incoming invoice register
  • Mobile
  • Professional
  • Project Controller
  • Report Manager

Other types of roles are system roles and user-defined roles. System roles are available by default, and user-defined roles are created by the user.

The Exact.Web.UI.Page.Base class has a protected property AppUserLicenseType, which is used to set the minimum level of license role is required to access the page.

Exact.Common.UserLicenseType is a type of AppUserLicenseType which consists of the following options:

  1. Basic - No license role is required.
  2. EmployeeSelfService – The Employee self-service role is required.
  3. BusinessCRM, or both the CRM and Employee self-service roles are required.
  4. CRM – The CRM role (excluding Employee self-service) is required.
  5. Fullsuite – The Professional role is required.

To set the minimum role needed for a custom page, configure the AppUserLicenseType on the custom page as follows:

Private Sub Page_Init()

AppUserLicenseType = UserLicenseType.EmployeeSelfService

End Sub

The AppUserLicenseType is a protected property. Thus, it only can be used directly on the page, and not in an application extension class. This means AppUserLicenseType defined for a page cannot be overwritten in the application extension class.

Return to top

 

Checking license roles for custom pages

The AppUserLicenseType property has only three license roles mentioned (Employee self-service, CRM, and Professional roles).

You can check the other license roles for custom pages based on the enumeration Exact.Common.LicensedRole and the function Exact.Core.Environment.IsUserInRole.

Enumeration Exact.Common.LicensedRole contains:

  • 60 - ReportManager
  • 71 - HourEntry
  • 72 - ProjectController
  • 73 - IIRBudgetHolder
  • 90 - ESSRole
  • 91 - CRMRole
  • 92 - ProfessionalRole
  • 93 – EnablingAddOnSolutions

Note: The mobile license role 950 - Mobile is not available in the above-mentioned enumeration.

The enum numbers are the IDs of the roles in the roles table (HRRoleDefs). To retrieve all the license-related roles in the roles table, the following query can be used:

SELECT * FROM HRRoleDefs WHERE Type IN (2,3)

The following code snippet is an example on how to check on the Enabling Add On Solutions role and give the user access to a page previously denied when the user does not have this role:

Private Sub Page_Init()

If Not env.IsUserInRole(Exact.Common.LicensedRole.EnablingAddOnSolutions) Then AccessDenied()
End If

End Sub

This check can be done directly on the page, or in an application extension.

Return to top

 

Related document

     
 Main Category: Support Product Know How  Document Type: Online help main
 Category: SDK  Security  level: All - 0
 Sub category: General  Document ID: 21.561.377
 Assortment:  Date: 08-07-2018
 Release: 244  Attachment:
 Disclaimer