views:

536

answers:

2

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?

A: 

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.

vinny
It's not that i want to redirect if there's an error, more that i want to change the access denied message the web part displays.
Rob
Unforuntately, I don't think it's just a matter of digging into the 12 hive. As far as I know, the only way to specify (alter) that text for built-in web parts is to use custom errors. Maybe someone else will jump in here?
vinny
Yar, the more i think about it the more i think you have to create you own webpart, inherit the list webpart and override the permission exception so you can control what's rendered.
Rob
A: 

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.

Alex Angas