I want add file and folder in tree view control for specific user if he has permission to access that file and folder. I want to get permission of file or folder to check current user can access that file or folder in share point client object model.
To check permissions to a list or library:
To check a list item its the same
To check a folder you do the check in the list item object of the folder:
Replace .AddListItems with .Open if you just want to check if they have read rights.
If you want to get the current user before elevating you code and iterating through content then the command is:
SPUser user = SPContext.Current.Web.CurrentUser;