Showing posts with label access denied. Show all posts
Showing posts with label access denied. Show all posts

Wednesday, February 22, 2012

Access Denied even to SharePoint Administrator

Message
Access Denied.
Editing/Settings are NOT enabled even for administrators.

Context
SharePoint Site Collection, maybe after backup/restore a site collection

Explanation
The Site Collection is in "Read only" mode. Maybe due to a stsadm backup brutally interrupted.

Solution
Open the SharePoint Central Administration. Under Application Magement, click on the "Configure quotas and locks" link. Than have a look under the section "Site Lock Information" and be sure it is selected "Not locked" option.

Monday, February 20, 2012

UnauthorizedAccessException opening UNC path file with FileStream


Message
UnauthorizedAccessException: Access to the path '...' is denied.


Context
Executing the following line of code (C# ASP.NET under Visual Studio, localFile or UNC path)

FileStream fs = new FileStream(fileName, FileMode.Open);

Explanation
ND

Solution
Add the fileaccess mode option "FileAccess.Read":
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);