I have sharepoint list/library. Only admin user has permission on this list. Now i want to display attachment to all authenticated user in my custom web part. How can i achieve this functionality.? Authenticated user is not able to view attachment. Access denied error display. How can i display attchment of list/library to user who does not have permission on list/library. Thanks in advance
Out of the box - its not possible. SharePoint security design works on the principle of item level security which means either an user has access to the item or he does not.
As long as the user does not have atleast read access on the list item , no matter whichever way you want to display the attachment , SharePoint would not allow the user to access it. In short, you give read access to the authenticated user on the list or the item with attachment to make it accessible.
Alternative way is through custom code.
Roughly the approach would be to create a webpart that runs on SP elevated security privileges and it displays the list attachment for download on the authentication of the app pool identity account of the web application where your site is hosted. The user can login and view this webpart on a page and download the list item attachment without "actually" having any permissions on the list.
The simplest solution is for the admin to grant read access to all authenticated users. If they are not willing to do this, but do agree that users should be able to see the attachments, then you should probably be looking into splitting the information into two lists somehow.