wiki:AccessMacro

Display or hide parts of wiki pages based on permissions

Description

This macro allows parts of wiki pages to be displayed or hidden depending on the permissions granted to a user viewing the page. It has two variants:

  • Make a block of wiki text visible only to users with one of a specified list of permissions.
  • Hide a block of wiki text for users with one of a specified list of permissions.

Limitations:

  • This will not be effective in hiding text from users with WIKI_EDIT permission, as they will see the text when editing the page (#5492).
  • Access control is not enforced for the wiki history and exported formats (#5554).

Bugs/Feature Requests

Existing bugs and feature requests for AccessMacro are here.

If you have any issues, create a new ticket.

defect

1 / 4

Download

Download the zipped source from here.

Source

You can check out AccessMacro from here using Subversion, or browse the source with Trac.

Installation

General instructions on installing Trac plugins can be found on the TracPlugins page.

Example

This is seen by everyone:

{{{
#!access
#allow(TICKET_ADMIN, MILESTONE_ADMIN)
}}}

This is seen only by users with one of the permissions TICKET_ADMIN or MILESTONE_ADMIN:

{{{
#!access
#deny(REPORT_VIEW)
}}}

This is seen only by users who do not have the REPORT_VIEW permission:

{{{
[[access(deny(REPORT_VIEW), This is an alternate syntax)]]
}}}

Recent Changes

6077 by turkanis on 2009-06-22 20:53:08
removed empty url
6076 by turkanis on 2009-06-22 20:48:18
added macro url
6075 by turkanis on 2009-06-22 20:46:56
added license
(more)

Author/Contributors

Author: turkanis
Maintainer: Jonathan Turkanis
Contributors:

Last modified 8 months ago Last modified on Nov 12, 2015, 12:05:03 PM