wiki:AccessMacro

Version 1 (modified by turkanis, 7 years ago) (diff)

New hack AccessMacro, created by turkanis

Display or hide parts of wiki pages based on permissions

Description

The Trac Access macro allows parts of wiki pages to be displayed or hidden depending on the permissions of the current user. It has two variants: the first makes a block of wiki text visible only by users with one of a specified list of permissions, and the second hides a block of wiki text for users with one of a specified list of permissions.

Bugs/Feature Requests

Existing bugs and feature requests for AccessMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from [download:accessmacro here].

Source

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

Example

This is seen by everyone

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

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

{{{
#!access
#deny(REPORT_VIEW)

This is seen only by users who do not have 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
Contributors: