wiki:ProtectedMacro

Version 1 (modified by frayja, 6 years ago) (diff)

New hack ProtectedMacro, created by frayja

Protect parts of a wiki page from invalid access

Description

With this plugin certain parts of a wiki page can be shielded from reading.

There are four explicit permissions. PROTECTED_VIEW, PROTECTED_RED_VIEW, PROTECTED_BLUE_VIEW, and PROTECTED_GREEN_VIEW. Each of these permissions allows view access to different parts (as seen in the examples below)

A #!protected part will be rendered with a red line to the left, a #!protected-blue part will be rendered with a blue line to the left, etc.

Note: a user who is allowed to edit the wiki page will always be able to see (and edit) protected parts.

Improvements:

  • Supply an admin feature to add/edit permission-xxx
  • Supply an admin feature to edit the default responce when no access is granted
  • Supply an admin feature to edit the style/template for a permission part

Bugs/Feature Requests

Existing bugs and feature requests for ProtectedMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

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

Example

{{{
#!protected
This will only be visible to those that have PROTECTED_VIEW
Will show all content with a red line to the left
}}}

{{{
#!protected-red
This will only be visible to those that have PROTECTED_RED_VIEW
Will show all content with a red line to the left
}}}

{{{
#!protected-blue
This will only be visible to those that have PROTECTED_BLUE_VIEW
Will show all content with a blue line to the left
}}}

{{{
#!protected-green
This will only be visible to those that have PROTECTED_GREEN_VIEW
Will show all content with a green line to the left
}}}

Recent Changes

[7628] by frayja on 2010-02-17 08:32:48
Fix by miau: the format must be checked since the action will be 'view' when you download a plain text
[6679] by frayja on 2009-10-12 14:53:40
A little code cleanup. The filter is part of wiki page security, so can be in the same class as the other wiki page security features
[6678] by frayja on 2009-10-12 14:43:12
Added a security filter on other view actions such as edit and diff

Author/Contributors

Author: frayja
Contributors: