---
schema_version: "1"
id: e1ede0dbbba3fedf80668b396dc7dcb5a9743fe63a92a46c74b552cb63dd386b
title: Implement the VlocityRequiredPermissionCheck Class (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_implement_the_vlocityrequiredpermissioncheck_class.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_implement_the_vlocityrequiredpermissioncheck_class.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0463d1fed13ac939f049d3faad1bac171ce0df60d1f5882c4fd59f454a2f8f4f
description: For the managed package runtime, for the DefaultRequiredPermission setting to work, you must implement the VlocityRequiredPermissionCheck class manually because Salesforce handles classes in managed and unmanaged packages differently. This class doesn't work properly if it's included in the managed package.
products:
  - Omnistudio
release: "264"
---
# Implement the VlocityRequiredPermissionCheck Class (Managed Package)

For the managed package runtime, for the DefaultRequiredPermission setting to work, you must implement the VlocityRequiredPermissionCheck class manually because Salesforce handles classes in managed and unmanaged packages differently. This class doesn't work properly if it's included in the managed package.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

If you're using Omnistudio Spring '22 or greater, and the **Managed Package Runtime** is set to **Disabled**, you don't have to implement this class.

For DefaultRequiredPermission details, see [Omnistudio Data Mapper and Integration Procedure Security Settings (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_dataraptor_and_integration_procedure_security_settings.htm&release=264.0.0&type=5 "For the managed package runtime, these settings affect Data Mapper and Integration Procedure security.").

1. From Setup, in the **Quick Find** box, type apex.
2. Click **Apex Classes**.
3. Click **New**.
    
    ![On the Apex Class Edit page, the Apex Class tab is selected and the cursor is at line 1. This is where you paste the code.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/apexclassnew.png)
4. Enter the following Apex code in the **Apex Class** tab:
    
    ```
    global class VlocityRequiredPermissionCheck implements Callable
    {
        global Boolean call(String action, Map<String, Object> args)
        {
            if (action == 'checkPermission')
            {
                return checkPermission((String)args.get('requiredPermission'));
            }
            return false;
        }
    
        private Boolean checkPermission(String requiredPermission)
        {
            Boolean hasCustomPermission = false;
            List<String> customPermissionsName = requiredPermission.split(',');
            for (String permissionName : customPermissionsName)
            {
                Boolean hasPermission = FeatureManagement.checkPermission(permissionName.normalizeSpace());
                if (hasPermission == true)
                {
                    hasCustomPermission = true;
                    break;
                }
            }
            return hasCustomPermission;
        }
    }
    ```
5. Click **Save**.