This issue occured when a user with read-only access would access a page with a web part that did some Excel parsing.
The code would throw an UnauthorizedAccessException error when attempting to instantiate the Microsoft.Office.Interop.Excel.Application() COM object, . To get around this in MOSS we can elevate the permissions to that of the SharePoint system account by wrapping that code as follows:
SPSecurity.RunWithElevatedPrivileges(
delegate()
{
// Put the code that needs to run with elevated permissions here
BashExcelSpreadsheet();
}
);
We love you SPSecurity
Subscribe to:
Post Comments (Atom)
1 comment:
If you would like to obtain a good deal from this
post then you have to apply such techniques to your won weblog.
Look at my web blog; attu
Post a Comment