2011년 1월 16일 일요일

Web Part Error: UnsafeControlException

WebPart Provisioning이 잘 되지 않고 아래와 같은 에러가 화면에 나오는 경우가 있습니다.

 
 

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action.

Hide Error Details

[UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action.]

  at Microsoft.SharePoint.WebPartPages.WebPartImporter.CreateWebPart(Boolean clearConnections)

  at Microsoft.SharePoint.WebPartPages.WebPartImporter.Import(SPWebPartManager manager, XmlReader reader, Boolean clearConnections, Uri webPartPageUri, SPWeb spWeb)

  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressWebPartNoSave(Boolean isClosed)

 
 

원인은 Anonymous가 설정 된 사이트인 경우 사이트 최초 시작 시에 anonymous로 바로 연결 하게 되면 WebPart Page내에 Provisioning된 webpart를 제대로 불러오지 못해서 그런 것 같습니다.

사이트 편집권한이 있는 사용자로 로그인 후 다시 anonymous로 접근하면 해결 되더군요.