You need to sign in to do that
Don't have an account?
![Chang Sun 6 Chang Sun 6](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Different ways to create permission sets
There are two ways to create permission set, but we are wondering which way is better and more sustainable.
1) Using Apex class to create a post install script and using query to add permission sets as well as the fieldAccess, classAccess, objectAccess etc.
2) Using standard customPermissionSet.permissionset-meta.xml to define a permission set with all settings in the same file.
Does anyone have any experience on which way is better? And what is the pros and cons for each method? Thanks!
1) Using Apex class to create a post install script and using query to add permission sets as well as the fieldAccess, classAccess, objectAccess etc.
2) Using standard customPermissionSet.permissionset-meta.xml to define a permission set with all settings in the same file.
Does anyone have any experience on which way is better? And what is the pros and cons for each method? Thanks!
You can use metadata api using meta.xml.
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_permissionset.
Thanks,
Yes, using meta.xml file is one of our option(point 2 in my previous post) But Salesforce does allow user to use APEX class to create a permission set. We are trying to figure out if that way is better or what is the pros and cons for that method.
Thanks,