function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JohnDuraiJohnDurai 

Checking Permission set and displaying the LWC component based on permission set

Hi All - I have custom LWC coponent (Notes Button) which is reusable for accorss the application. Now, I need to check permssion set based on the permisson set and if the permssion set has read only access, then the below pop up shoud disable the save and cancel button for non editable and it the permssions set has both read and edit then it can be editable.

User-added image
Danish HodaDanish Hoda

Use CustomPermission, add the reqd permission set into it and import into your JS file, as below. If it returns true, it means the permission set is assigne dto the user/Profile, else disable the button : 

import <CustomPermissionNameVariable> from '@salesforce/customPermission/<CustomPermissionAPIName>';