Edit the "Not Permitted" velocity page in Confluence?

Mike Rocheleau March 30, 2014

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
Answer accepted
Sabine Winkler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

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

0 votes
Mike Rocheleau March 31, 2014

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
TAGS
AUG Leaders

Atlassian Community Events