Change “access denied…” text string for document library web part

☆樱花仙子☆ 提交于 2019-12-11 04:41:13

问题


I have a MOSS publishing site and a document library with it's own unique permissions.

On the site home page (default.aspx) I have a document library webpart that shows a list of documents. If the user does not have permissions to view the documents the web part currently displays the message

"Access denied. You do not have permission to perform this action or access this resource."

is there a way to change this message to something more friendly?


回答1:


If inheriting doesn't work out, you could also use jQuery to look for the error message and replace it with something friendly.

There is info about setting up jQuery in SharePoint in this question.




回答2:


I'm not sure I'd fuss with editing the existing .aspx files and go with custom error messages instead:

http://blogs.msdn.com/ketaanhs/archive/2009/03/16/moss-sharepoint-2007-custom-error-page-and-access-denied-page.aspx

Short version is that you use a custom httpmodule and make a couple of web.config changes to make sure the module is loaded and is called on error.



来源:https://stackoverflow.com/questions/752676/change-access-denied-text-string-for-document-library-web-part

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!