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

Hi,

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;html&gt;
&lt;head&gt;
    &lt;title&gt;$action.getText("title.not.permitted")&lt;/title&gt;
&lt;/head&gt;
&lt;body style="margin:5px"&gt;

    #parse ( "/breadcrumbs.vm" )

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

        &lt;p&gt;$action.getText("not.permitted.description")&lt;/p&gt;

    &lt;/div&gt;

&lt;/body&gt;
&lt;/html&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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked Thursday in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

159 views 5 7
View question

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