Set Apex Class Access from the Class Detail Page

Limit which users can execute methods in a particular top-level Apex class based on their profiles.

Required Editions

Available in: Salesforce Classic (not available in all orgs) and Lightning Experience
Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions
User Permissions Needed
To set Apex class security:

Manage Profiles and Permission Sets

AND

View Setup and Configuration

  1. From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  2. Click the name of the class that you want to restrict.
  3. Click Security.
  4. Select the profiles that you want to enable from the Available Profiles list and click Add, or select the profiles that you want to disable from the Enabled Profiles list and click Remove.
  5. Click Save.