Page creation by system user

Vote:
 
I am using the task function (Schemalagda jobb) in EPiServer to automatically create pages in certain intervals. This is working great when I click the "Provkör manuellt" button, but the automatic function throws a "Access was denied to page" error. It seems to be a user right issue. The manual function uses my user account without restrictions while the automatic function uses the system account for the task service without necessary rights. What can I do to give the system account necessary rights to create pages automatically? I can see two solutions which both open for a great security leak: 1) Give Create rights for everyone to the page container. 2) Add the system account to the Administrators group. /René
#12326
Mar 25, 2008 18:34
Vote:
 
Hi. The DataFactory.Save method has an overload which takes in the parameter AccessLevel Access: public PageReference Save(PageData page,SaveAction action,AccessLevel access) You will find the access level you need to save the page in the static member called NoAccess in the class EPiServer.Security.AccessControlList, hence if you enter EPiServer.Security.AccessControlList.NoAccess as the input for the Save method, you will be able to save the page regardless the security settings. Frank :)
#14063
Mar 25, 2008 18:44
Vote:
 
Thanks for your suggestion, unfortunately this solution is not solving the access rights problem. It seems to be the access right for the container page that is messing up, the AccessLevel in the Save method seems to affect the access right for the "newly created" (never created) page instead.
#14064
Mar 25, 2008 18:44
Vote:
 
Smooth, now it works, I had to set the AccessLevel in the Global.EPDataFactory.GetDefaultPageData too. ;)
#14065
Mar 25, 2008 18:44
Vote:
 
You need to personate as a user with the neccessary rights to do the things you're trying to do. Do the same as shown in http://www.episerver.com/templates/faq____943.aspx, but use an account with more rights.
#14066
Mar 25, 2008 18:44
* 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.