No access to DAP Apex Classes

Last published at: 2022-10-13 14:07:09 UTC

Question:

- I get an error about not having access to a class: "You do not have access to the Apex class named 'xx'". 

- I was informed I should get access to a certain class in order to use a feature.

Answer:

If you get an error message stating that you don't have access to a certain class, or if you are lacking access to a certain class, this means you were given access to the other DAP classes via your user profile. Either a new class was added in the latest Data Action Platform release, or you were not given access to all classes in the first place. Follow the steps in 'Add the class to a user profile' below to add access to the class.

Add the class to a user profile

Start with enabling the Enhanced Profile User Interface setting, to make sure you can view all available DAP Apex classes.

  1. Go to Salesforce Setup.
  2. Go to Users > User Management Settings.
  3. Enable Enhanced Profile User Interface.

Then, add the class from the error message, plus any other missing classes, to your profile.

  1. Go to Salesforce Setup > Users > Profiles.
  2. Find the profile you want to edit and click on the profile's name.
  3. At the profile overview, scroll down to Apex Class Access and click Edit.
  4. At Available Apex Classes, find the missing class and move it to Enabled Apex Classes.
  5. If you see any other classes that start with "dap" or "plauti" listed under Available Apex Classes, move those to Enabled Apex Classes as well.
  6. Click Save.

Repeat for all other user profiles that need to work with the Data Action Platform.

The error about this class should not occur anymore. Have the user log out and in again if the problem persists. Read on to see how you can prevent this error from happening again.

Prevent the error from happening again

New classes in release notes

When a Data Action Platform release contains new classes, this is mentioned in the Release Notes‍. Add the listed classes to all user profiles that need to work with the Data Action Platform.

User profile or DAP Permission Set

For the Data Action Platform to work correctly, you need to grant your users access to all DAP Apex classes. There are two possible ways to go about this. You can grant classes access to specific user profiles, or assign the DAP Permission Set to individual users.

The advantage of using the DAP Permission Set is that it is updated automatically. This means you don't need to make any changes after a DAP update was released thats contain new classes. However, with the DAP Permission Set, users have access to all of the Data Action Platform, including all settings.

If you don't want your users to access certain DAP pages, such as DAP Setup or DAP Job, make sure to deny them access to those pages.

Assign the DAP Permission Set

This option grants users access to all of the Data Action Platform.

  1. Go to Salesforce Setup > Users > Permission Sets.
  2. Click the Data Action Platform for Salesforce permission set.
  3. At the top, click Manage Assignments.
  4. Click Add Assignments.
  5. Select the users you want to assign the permission set to.
  6. Click Assign.

You have now granted full access to the Data Action Platform, including all classes for current and future DAP releases, to the selected users.

To deny access to certain DAP pages:

  1. Go to Salesforce Setup > Users > Permission Sets.
  2. Find the profile you want to edit.
  3. On the profile, go to Object Settings.
  4. Find the DAP tabs you want to hide and edit. 
  5. Under Tab Settings, select Tab Hidden.
  6. Click Save.