Changes between Version 3 and Version 4 of TracBasicMacro


Ignore:
Timestamp:
Jul 19, 2010, 9:06:16 PM (4 years ago)
Author:
olemis
Comment:

Documented ConfigOption and related security settings.

Legend:

Unmodified
Added
Removed
Modified
  • TracBasicMacro

    v3 v4  
    55== Description ==
    66
    7 Expand Trac capabilities by embedding simple snippets in wiki pages using simple macros.
     7Expand Trac capabilities by embedding simple snippets in wiki pages using simple macros. 
    88
    9 ==== !ConfigOptionMacro ====
     9=== !ConfigOptionMacro ===
    1010
    1111Insert configuration options in Wiki pages
    12 
    13 Usage is as follows.
    14 
    15 `[[ConfigOption(section, name, type=option_type, sep=char)]]`
    16 
    17   - ''section'' :  the section in trac.ini (mandatory)
    18   - ''name'' :     option name (mandatory)
    19   - ''type'' :     if this keyword argument is present then
    20     the value will be rendered using an
    21     appropriate format according to the option
    22     type. Supported values are `text` (default),
    23     `bool`, `int`, `list`, `path`, `extension`.
    24   - ''sep'' :      list separator (otional, ignored if
    25     `type`! = `list`)
    2612
    2713==== !WikiHistoryMacro ====
     
    3016If invoked without keyword arguments then full
    3117changelog is shown inside a table with columns
    32 `Date`, `Version`, `Description, `Author`. Please
     18`Date`, `Version`, `Description`, `Author`. Please
    3319read below for further details.
    34 
    35 Usage is as follows (all fields are optional).
    36 
    37 `[[WikiHistory(pagename, version, attr=attr_name, cols=columns)]]`
    38 
    39   - ''pagename'' : the name of target Wiki page. If missing or empty
    40     and a wiki page is being rendered then it defaults to
    41     the current wiki page. If the page being rendered
    42     doesn't belong in the Wiki then `WikiStart` is used instead.
    43   - ''version'' :  consider changes prior to (and including) this version
    44   - ''attr'' :     if this keyword argument is present then only the value
    45     of the version attribute identified by `attr_name` is
    46     rendered in textual form (and `cols` argument is ignored)
    47     Supported values are `time`, `version`,
    48     `comment`, and `author`
    49   - ''cols'' :     colon separated list of identifiers used to select
    50     specific columns (order matters). Identifiers are
    51     the same supported for `attr` parameter.
    52 
    5320
    5421== Bugs/Feature Requests ==
     
    7037== Example ==
    7138
     39Install the plugin and enable [TracBasicMacro TracBasicMacros] plugin by inserting the following lines in [TracIni trac.ini].
     40
     41{{{
     42[components]
     43tracbm.* = enabled
     44}}}
     45
     46All the macros will be ready to use in your Trac environment. For up-to-date documentation consult `TracMacros` page in your local environment.
     47
    7248  - `[[ConfigOption(project, name)]]` displays project name.
     49  - `[[ConfigOption(trac, auto_reload, type=bool)]]` displays a check-box indicating
     50    whether the option is set or not
     51  - `[[ConfigOption(trac, auto_reload)]]` idem. the macro is able to lookup
     52    metadata describing the option (if it's registered in the global `Option`'s registry)
     53  - `[[ConfigOption(olemis, simelo, type=text)]]` displays something like ~~ Missing ? ~~ ''';o)'''
     54  - `[[ConfigOption(timeline, default_daysback, type=int)]]` displays default number of
     55    days displayed in the `Timeline`, in days. Integers are displayed like this `30`.
     56  - `[[ConfigOption(trac, metanav, type=list)]]` Display a list of ''metanav'' options.
     57    Output looks like this
     58
     59  - login
     60  - search
     61  - help
     62
     63  - `[[ConfigOption(trac, permission_store, type=extension)]] ` display the component
     64    responsible of storing user permissions.
     65  - `[[ConfigOption(trac, permission_policies, type=extension_list)]]` display active
     66    permission policies.
     67  - `[[ConfigOption(trac, permission_policies, type=extension_list, include_missing=true)]]`
     68    display all permission policies, active first.
     69
     70'''Important ! ''' Administrator must specify permissions (i.e. permission names) needed to view a particular configuration option by adding entries under `config-perm` section in [TracIni trac.ini]. Option names will be of the form `section.option`, `section.*` or `*` in order to make reference respectively to a particular option, all options in a section , or any option. For instance, the configuration shown below
     71
     72{{{
     73[config-perm]
     74* = TRAC_ADMIN
     75project.* = WIKI_VIEW
     76project.name = *
     77}}}
     78
     79will allow users with `TRAC_ADMIN` privilege to see any option, whereas all those able to read wiki pages may see any option under `project` section. Finally , any user will be able to see the project name.
     80
    7381  - `[[WikiHistory]]` lists versions of current wiki page (or
    7482    `WikiStart` if wiki text inserted elsewhere e.g. in a ticket's comment)
     
    9098    version 2 of `TracPermissions` wiki page.
    9199
    92 
    93100== Recent Changes ==
    94101