+ Start a Discussion
Darshan YadavDarshan Yadav 

Check if user has permissions on a file?

I have foloowing information with me
  1. UserID
  2. FileId
  3. OAuthusing user who has Modify ALl data Permissions (Admin)
I want to figure out if user(UserId) has permissions on a file(fileId) and what kind of permissions user has. 

I want to use rest APIs.

Any help will be appritiated. 

Thanks 
VinayVinay (Salesforce Developers) 
Hi Darshan,

You might also need to check below permissions.

>> Administrative Permissions section---->Select Files from Salesforce checkbox.
>> 'API enabled' on profile.

Review below link for details on sing Salesforce Files.

https://help.salesforce.com/articleView?id=collab_files_overview.htm&type=5

Thanks,
Vinay Kumar
Darshan YadavDarshan Yadav
I have these permissions with me. I am looking around which rest APIs i need to use. From File Id i am able to get file  deatils from ContentVersion. But i am not able to figure out how to get all users who has access on that file. Or if a specific user has access on that file. 
 
VinayVinay (Salesforce Developers) 
Hi Darshan,

You can check below links which have few working sample code snippet.

https://developer.salesforce.com/forums/?id=9060G0000005rk3QAA
https://medium.com/@weirdthinker15/uploading-a-document-to-salesforce-using-rest-api-a7481324812a
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm

Thanks,
Vinay Kumar