---
schema_version: "1"
id: 77bf957adc133aed1d5cd93a380ccebb393f2aedaf8750b431bf36f0c2b0c264
title: Implement the VlocityRequiredPermissionCheck Class
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_56669.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_implement_the_vlocityrequiredpermissioncheck_class_56669.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: deb59a418b2e1e1af54869a425db2d9eb739bcdfc46ceb40047309a2dab096fa
description: 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 Vlocity managed package.
products:
  - Omnistudio
release: "264"
---
# Implement the VlocityRequiredPermissionCheck Class

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 Vlocity managed package.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/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](https://help.salesforce.com/s/articleView?id=xcloud.os_dataraptor_and_integration_procedure_security_settings_48215.htm&release=264.0.0&type=5 "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-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/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**.