I want to grant users to see images if they know the direct link (e.g. /MyPicLib/test.jpg). However the users should not be able to open "/MyPicLib/Forms/AllItems.aspx". I tried the available permission levels like "Restricted read" and also tried to create my own custom permission but it didn't work. Any ideas?
The problem is that if you have access to items in a folder, then you can go to that folder and see the items you have access to even though you don't have any permissions on the folder.
One solution could be to put each picture into it's own folder like
/MyPicLib/Logo/Logo.jpg. If you then don't give users any rights to the list, but break inheritance on each picture and gives them read View rights, then users will be able to see the image and goto the folder
/MyPicLib/Logo and see the image exists, but they will not be able to see which folders exist.
Was my mistake. The restricted read is exactly doing what I want. So the solution was: Opened permissions of my picture lib, stop permission inheritance and set the group to "Restricted Read" instead of "Read". Now they can see the pictures by the direct url, but cannot open the library.