]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/ACL.mdwn
mark done.
[ikiwiki.git] / doc / todo / ACL.mdwn
1 How about adding ACL? So that you can control which users are allowed
2 to read, write certain pages. The moinmoin wiki has that, and it is
3 something, that I think is very valuable.
4
5 > ikiwiki currently has only the most rudimentary access controls: pages
6 > can be locked, or unlocked and only the admin can edit locked pages. That
7 > could certianly be expanded on, although it's not an area that I have an
8 > overwhelming desire to work on myself right now. Patches appreciated and
9 > I'll be happy to point you in the right directions.. --[[Joey]]
10
11 >> I'm really curious how you'd suggest implementing ACLs on reading a page.
12 >> It seems to me the only way you could do it is .htaccess DenyAll or something,
13 >> and then route all page views through ikiwiki.cgi. Am I missing something?
14 >> --[[Ethan]]
15
16 >>> Or you could just use apache or whatever and set up the access controls
17 >>> there. Of course, that wouldn't integrate very well with the wiki,
18 >>> unless perhaps you decided to use http basic authentication and the
19 >>> httpauth plugin for ikiwiki that integrates with that.. --[[Joey]]
20
21 >>>> Which would rule out openid, or other fun forms of auth. And routing all access
22 >>>> through the CGI sort of defeats the purpose of ikiwiki. --[[Ethan]]
23
24 Also see [[!debbug 443346]].
25
26 > Just a few quick thoughts about this:
27 >
28 >* I'm only thinking about write ACLs.  As Joey noted, read ACLs need to be done in the web server.
29 >* ACLs are going to be really hard for people with direct access to the revision control system.
30 >  Which means that we really only need to define ACLs for web access.
31 >* ACLs for web access can then be defined by the web master.  These might not need to be
32 >  defined in the wiki pages (although they could be).
33 >* Given the previous two points, can't this be done with the `match_user()`
34 > function defined by the [[plugins/attachment]] plugin (see the [[ikiwiki/pagespec/attachment]] pagespec info)
35 > and the [[plugins/lockedit]] plugin (see [[page_locking]])?
36 >
37 > For example, add the following to your config file:
38 >
39 > locked_pages => '!(user(john) and */Discussion) and *',
40 >
41 > would lock all pages unless you're john and editing a Discussion page.
42 > It's a thought anyway :-).  -- [[Will]]
43
44 >> Yes, writing per-user commit ACLs has become somewhat easier with recent
45 >> features. Breaking `match_user` out of attachment, and making the
46 >> lockedit plugin pass`user` and `ip` params when it calls `pagespec_match`
47 >> would be sufficient. --[[Joey]]
48
49 I am considering giving this a try, implementing it as a module.
50 Here is how I see it:
51
52   * a new preprocessor directive allows to define ACL entries providing permissions
53     for a given (user, page, operation), as in:
54
55     <pre>
56     \[[!acl user=joe page=*.png allow=upload]]
57     \[[!acl user=bob page=/blog/bob/* allow=*]]
58     \[[!acl user=* page=/blog/bob/* deny=*]]
59     \[[!acl user=http://jeremie.koenig.myopenid.com/ page=/todo/* deny=create
60            reason="spends his time writing todo items instead of source code"]]
61     </pre>
62
63     Each would expand to a description of the resulting rule.
64
65   * a configurable page of the wiki would be used as an ACL list.
66     Possibly could refer to other ACL pages, as in:
67
68     <pre>
69     \[[!acl user=* page=/subsite/* acl=/subsite/acl.mdwn]]
70     </pre>