Edit the "Not Permitted" velocity page in Confluence?

I'd like to add some text to the "You are not permitted to perform this operation" generic page that shows when a user hits something in Confluence they have no access to. Specifically when accessing spaces they have no rights to.

I've seen another question here for the same thing and a link to the velocity pages, but I'm just not certain how to actually add something and have it display.

I'm running Confluence 5.3.4, I have a user macro called "spaceadmins" which shows whomever might be a space admin for the current space. So I want to have the not permitted page show:

You do not have permissions to this content, please contact these folks for access: <spaceadmins>

I've tried adding just the following into the existing div tag, within the body tag, in pagenotpermitted.vm: $helper.renderConfluenceMacro("{spaceadmins}") But I see no change to the page when I restart Confluence. Adding plain text within this div tag also doesn't reflect to a 'not permitted' page when I restart Confluence.

Any trick to this? Confluene restarted, cache cleared, etc.

2 answers

1 accepted

0 votes
Accepted answer


it looks like your change and what you have tested are two different thing.

It looks like your test is pointing to the Velocity template "notpermitted.vm" (located in confluence-x.x.x-source\confluence-project\confluence-core\confluence-webapp\src\main\webapp)

&lt;body style="margin:5px"&gt;

    #parse ( "/breadcrumbs.vm" )

    &lt;div id="content" style="margin:10px;"&gt;




I guess this template is called if the user is not allowed to access a certain space. The template you mentioned to modify seems to work for pages within a space. So I assume the pagenotpermitted.vm is called if the user has access to the space BUT not to a defined page within.

HTH, Sabine

Oh wow that's it exactly, thank you Sabine! I didn't notice this other velocity file, and for my install it's in the 'confluence' directory in the install folder.

Confirmed my macro does load in there! Downside is it's not correctly showing the space admins for the space, but that's something I can fiddle with in the macro.

Thanks so much!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

476 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you