Try our conversational search powered by Generative AI!

Image gallery not allowing anonymous access

Vote:
 

Hi,

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?

#54233
Oct 06, 2011 10:30
Vote:
 

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

#54240
Oct 06, 2011 11:40
Vote:
 

Yes, and I have checked the filepermissions aswell.

#54242
Oct 06, 2011 11:52
Vote:
 

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);
else
    EntitySecurityHandler.Instance.SetAccessRights(entity, group, accessRights);

 

#57530
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.