0

I performed a push upgrade of the latest version of the managed package in Salesforce and all the new apex classes that were introduced as part of this version do not show as being enabled when I look at the "Enable Apex Classes Access" page under the profile for the org where the new version of the managed package was pushed.

I can move these new apex classes from "Available Apex Classes" to "Enabled Apex Classes" and then it will work but I cannot expect to have all my customers to have to do this manual step everytime I introduce a new Apex class. How do I fix this?

1 Answer 1

1

all the new apex classes that were introduced as part of this version do not show as being enabled when I look at the "Enable Apex Classes Access" page

That's the expected behavior. Push upgrades do not alter permissioning in the subscriber org, even for new components. (You can replicate this behavior for testing by deploying the package using the Metadata or Tooling APIs, where you can set an option on your install request to the value "PUSH" to get the same mode of operation).

I cannot expect to have all my customers to have to do this manual step everytime I introduce a new Apex class. How do I fix this?

Package and deliver Permission Sets within your managed package that grant access to the required elements of your package. You can either push-upgrade changes to already packaged Permission Sets, or you can push-upgrade new Permission Sets to cover new features you are shipping.

5
  • Thanks for the reply, a bit confused though. The logged in user is a system admin and all the apex classes that were part of the original version was enabled for a system admin, the new classes are not. Which permissions should those new classes be added to? What about the existing classes?
    – Felix
    Nov 23, 2020 at 20:31
  • @Felix You would need to start shipping Permission Sets if you aren't already to make this as easy as possible on your users. Alternately, you can choose to handle it through documentation and have the user take responsibility for updating their Profiles, such as System Adminstrator.
    – David Reed
    Nov 23, 2020 at 20:37
  • I created a Permission Sets and in there I found a section called "Apex Class Access" and in there I selected all of my apex classes for my app. Next do I add this permission set to my managed package and then release and push this managed package?
    – Felix
    Nov 23, 2020 at 20:53
  • Hold up a sec. This is something where you really need to think through the permissions architecture of your product. You can't delete those permsets after you ship them. And the customer will need to assign them manually. Just throwing a permset with Apex Class Accesses into your package doesn't achieve much. You'll want to think through your overall permissioning strategy. Or just tell the customer to assign the classes in their profiles.
    – David Reed
    Nov 23, 2020 at 23:47
  • Trying to keep this as simple as possible. I just want users to be able to access the apex classes and not get errors such as "You do not have access to the apex class named: XYZ". I do not need different permission levels for different apex classes or have different categories of users.
    – Felix
    Nov 24, 2020 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.