Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Implement the VlocityRequiredPermissionCheck Class

          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
          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.

          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.
          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.
           
          Loading
          Salesforce Help | Article