Activity Forums Salesforce® Discussions How can we get the list of users who have the read permission on the case in salesforce?

  • How can we get the list of users who have the read permission on the case in salesforce?

    Posted by Mohit on January 5, 2017 at 11:25 am

    Hi All,

    How can we get the list of user those who have the read permission on the case sObject?

    We have a scenario in which we want a list of user those who have the read permission on the case sObject in salesforce?

    Please give suggestions

    • This discussion was modified 7 years, 11 months ago by  Mohit.
    • This discussion was modified 7 years, 11 months ago by  Forcetalks.
    • This discussion was modified 7 years, 11 months ago by  Forcetalks.
    Vikas Kumar replied 7 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Vikas Kumar

    Member
    January 5, 2017 at 12:59 pm

    Hi Mohit,

    To find out if a particular user has Edit access to a record, use the UserRecordAccess object. This object is available in API version 24.0 and later. You can use SOQL to query this object to find out if the user has edit access to the record in question.

    SELECT RecordId, HasEditAccess FROM UserRecordAccess WHERE UserId = [single ID] AND RecordId = [single ID]

    If you want to check a batch of records you can use

    SELECT RecordId FROM UserRecordAccess WHERE UserId=:UserInfo.getUserId() AND HasReadAccess = true AND RecordId IN :allRecordIds LIMIT 200

    Hope it may helps

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos