Salesforce.com own apps are licenced using a fine-grained hierarchy of user
licenses and add-on licences where each license has costs and restricts what I can do in an app.
As an ISV selling
Managed packages through the AppExchange and the
LMA app I am mostly restricted to a Yes/No type licensing. Either a User has permission to my app or not.
Sure I can build in a detailed model of permissions of
- Permission Sets
- Custom Permissions
- Permission Set Groups
and check for them in my code using
FeatureManagement.checkPermission('CustomPermissionName'). But only the subscriber admin decides who gets assigned such Permissions. There is no way I as the app vendor can say "You can only assign the "TimeMachine" Permission to 2 users.
This on the other hand can be done by using the Feature Management App (FMA) but there is no connection to this hierarchy and power of Permissions.
I would like to combine the two concepts by
- having a
Feature Parameterassigning a distinct
Permission Set Groupto a user
- check in code if the user has this Feature enabled.
- Reject the call if he is not allowed.
But as I understand to do that I would need to control which user gets assigned which of my packaged permissions. But it looks like I just cant do that. There is no
PermissionAssignement trigger or something?