I am currently trying to check for a user for a permission set. Currently I have a permission set to give view access to a details object page. Users can access page by clicking on a number link on the Account page. I need to be able to check if a user has a permission set before accessing details page. I have created the Permission set and have assigned the correct profiles. I'm aware Perm Sets go off users, but here's were things get tricky. We have a 6.02 profile, there is more then one type of users within that profile. Meaning the 6.02 profile has multiple users each type of user having a different access to read and edit views. If anyone knows what direction to start heading after creating the permission set, that would be great!
-
This is a bit open-ended. You may want to edit your post and focus the question on one part for now (ex. How to query which permission sets users have access to in a LWC)– Kris GoncalvesCommented Feb 4, 2020 at 17:47
-
I know there's so many parts to it. I'll fix it up to sound more priority focused.– GevinCommented Feb 4, 2020 at 17:53
Add a comment
|
1 Answer
You could create a Custom Permission and add it to the Permission Set.
Then in Apex you can check for the custom permission using:
FeatureManagement.checkPermission('<custom_permission_api_name>')
-
Thanks for that bit. I'm currently collecting all permissions a user has and putting them into a List, then checking the list. If I have any issue with my current code, this seems like it could definitely help me. Than you for your help jonathanwiesel!– GevinCommented Feb 4, 2020 at 18:18