1

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!

2
  • 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) Feb 4 '20 at 17:47
  • I know there's so many parts to it. I'll fix it up to sound more priority focused.
    – Gevin
    Feb 4 '20 at 17:53
2

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>')
1
  • 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!
    – Gevin
    Feb 4 '20 at 18:18

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.