Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Account access right does not match while the account used programmatically

$
0
0

I have created an account and assigned full access to it for the whole tree. When I try to use that account programmatically in a scheduled job by calling 

PrincipalInfo.CurrentPrincipal = PrincipalInfo.CreatePrincipal(ConfigurationManager.AppSettings["ScheduledJob.AdminUser"]);

I get an exception 

Access was denied to content X. The current user does not have sufficient rights to delete the page with id X.

while I try to call _contentRepository.MoveToWastebasket(content.ContentLink). But when I manually log in the edit mode with the same account, I have no problems with moving content to waste basket.

How should I use the account in order to be able to move content to the waste basket programmatically?


Viewing all articles
Browse latest Browse all 9076

Trending Articles