Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Image gallery not allowing anonymous access



I'm using the image gallery and on the test environment everything works fine, but in production the image gallery images is not displayed for anonymous users, instead they are redirected to the login page. I have checked all the location tags related to the images in web.config and they allow anonymous users.

Any idea what I could've missed?

Oct 06, 2011 10:30

Is the virtual directory for the image gallery thumbnails properly set up in IIS?

Oct 06, 2011 11:40

Yes, and I have checked the filepermissions aswell.

Oct 06, 2011 11:52

Are you using EPiServer supplied templates or created your own? Maybe you need to set access permissions for images explicitly? See CommunitySecurityModule from Relate Sample Site source code.


ImageGalleryHandler.Instance.ImageAdded += new EPiServerCommonEventHandler(ImageGalleryHandler_ImageAdded);


And then:


void ImageGalleryHandler_ImageAdded(string sender, EPiServerCommonEventArgs e)
    SetAccessRightsForEntity((Image)e.Object, ((Image)e.Object).ImageGallery);


Which actually turns into:


if (user != null)
    EntitySecurityHandler.Instance.SetAccessRights(entity, user, accessRights);
    EntitySecurityHandler.Instance.SetAccessRights(entity, group, accessRights);


Mar 19, 2012 15:11
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.