Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hey, Øyvind,
Are you doing this from a scheduled job? Can you add the following before you start deleting:
EPiServer.Security.PrincipalInfo.CurrentPrincipal = EPiServer.Security.PrincipalInfo.CreatePrincipal(some_admin_user_who_has_delete_rights);
BR,
Marija
I have some code thats gets files from a service. If a file is changed i will first update the file and after delete the old versions of this content (do this to save disk space)
When i try to delete old versions i get this error in my logs
EPiServer.Core.AccessDeniedException: Access was denied to content 13893_94956. The required access level was "Delete".
This line fails
versionRepository.Delete(epiFileVersion.ContentLink);
How to fix this?
Entire code