DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:aclplusregex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Both sides next revision
plugin:aclplusregex [2020-05-04 12:59]
andi
plugin:aclplusregex [2021-01-21 12:13] (current)
annda [Examples]
Line 6: Line 6:
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       : action type       : action
-lastupdate : 2020-05-04+lastupdate : 2021-01-19
 compatible : greebo compatible : greebo
 depends    :  depends    : 
Line 38: Line 38:
 Unlike in the normal ACL configuration, the user/group part expects a regular expression. If it matches against the current user's login or groups the line will be treated as an additional ACL configuration. Unlike in the normal ACL configuration, the user/group part expects a regular expression. If it matches against the current user's login or groups the line will be treated as an additional ACL configuration.
  
-The special thing about this plugin is is that you may use any matched pattern groups from the regexp in the page/namespace part. In addition, placeholders may be used: a ''*'' to match a single namespace or pagename and ''**'' to match an arbitrary number of namespaces.+The special thing about this plugin is is that you may use any matched pattern groups from the regexp in the page/namespace part. In addition, placeholders may be used: a ''*'' to match a single namespace or pagename and ''%%**%%'' to match an arbitrary number of namespaces.
  
 The file can also be edited through the [[plugin:confmanager|Confmanager Plugin]]. The file can also be edited through the [[plugin:confmanager|Confmanager Plugin]].
Line 67: Line 67:
 </code> </code>
  
-Please note that above example use the ''*'' placeholder. The rule would match ''docs:customer:0815:foo'' but not ''docs:customer:0815:foo:bar''. Use the ''**'' placeholder to match all namespaces bolow.+Please note that above example use the ''*'' placeholder. The rule would match ''docs:customer:0815:foo'' but not ''docs:customer:0815:foo:bar''. Use the ''%%**%%'' placeholder to match all namespaces bolow.
  
 A similar setup could be done where you have two groups for each customer: ''customer_<customerid>_write'' and ''customer_<customerid>_read''. You could use this to give different access levels to the customer namespace: A similar setup could be done where you have two groups for each customer: ''customer_<customerid>_write'' and ''customer_<customerid>_read''. You could use this to give different access levels to the customer namespace:
Line 83: Line 83:
 </code> </code>
  
 +You can also use regular expressions in the id part of the configuration line like this:
 +<code>
 +docs:customer:$1:(\d{3})   @customer_(\d{5})_sub   4
 +</code>
 +
 +Note that you **have to** define your pattern as a group and put it in parentheses, otherwise it won't be recognized as regex.
 +
 +The above would allow user in a group like ''@customer_54321_sub'' to create pages in namespaces such as
 +  * ''docs:customer:54321:001''
 +  * ''docs:customer:54321:002''
 +  * ''docs:customer:54321:003''
  
 ===== Changleog ===== ===== Changleog =====
plugin/aclplusregex.1588589962.txt.gz ยท Last modified: 2020-05-04 12:59 by andi