London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
An alternative solution could be to impersonate a user with sufficient permissions in the scheduled job,
/johan
Hi Nitin.
You can get the UnifedDirectory by giving bypass access check this way:
UnifiedDirectory dir = EPiServer.Web.Hosting.VirtualPathHandler.Instance.GetDirectory("virtualPath", true) as UnifiedDirectory;
if(dir != null)
{
// Do your stuff
}
But the best way is probably to impersonate as Johan says. Look at Erik Nordin`s blog for a great example on impersonation in a scheduled job. http://antecknat.se/blog/2009/03/04/scheduled-tasks-tips/
Hope this helps!
Br, Tore
I am trying to access a VPP folder through Job-Subscription.
This folder do not have EVERYONE access rights defined in FileManagement, and as Job-Scheduler needs Everyone access to explore this folder through code it fails. and gives error as "Dont have sufficient access to this folder".
UnifiedDirectory dir = HostingEnvironment.VirtualPathProvider.GetDirectory(VirtualPath) as UnifiedDirectory;
How will you give BYPASSACCESSCHECK to a Unifieddirectory as the above statement gives error.