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
dinesh abcdinesh abc 

How to disable inputfield based on role in lwc

ANUTEJANUTEJ (Salesforce Developers) 
Hi Dinesh,

I found that you can import Role field from the schema which you can compare to see if you want to allow the user to see the field of if you want to hide the field from the user.

I found the below implementation which you can refer to get an idea of importing name field from @salesforce/schema/User.Name to use it in your implementation.

>>https://rajvakati.com/2019/02/11/get-current-user-details-in-lightning-web-components/

Also I found the below documentation which helps in getting official information regarding @salesforce modules.

>> https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_salesforce_modules

Hope this is helpful for your implementation please close the thread by marking a best answer so that it can be useful for others in the future and it would also be helpful in keeping the community clean.

Regards,
Anutej