Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Access Denied on some of SPSite properties that is running under elevated privilages.

$
0
0

Hi guys,

Please have a look at the code below, it's the execution method of the Timer job.

public override void Execute(Guid targetInstanceId)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(RootWebUrl))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        site.AllowUnsafeUpdates = true;
                        web.AllowUnsafeUpdates = true;
                        ProcessWeb(web);
                    }
                }
                this.Delete();
            });
        }

SPSite.Owner throws "Access Denied". A lot of SPWeb properties also throws a lot of "Access Denied". Any ideas?

Thanks in advance...


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>