1 it [[!tag wishlist]] would be nice to have acls that get their data from wiki pages.
3 a particular use case is the [debienna wiki](http://debienna.at/) (our local
4 debian usergroup), where there are few admins, but everyone who has been
5 granted edit rights to the wiki should be allowed to allow other people in.
6 those people can register their accounts on their own, but may only write to a
7 dedicated page where they request write privileges.
9 the setup file should look like this:
11 locked_pages: '!PleaseClearForEditing and !user_in_page(DebiennaGroup)'
13 and DebiennaGroup would contain
21 a suggested implementation is published on
22 `git://prometheus.amsuess.com/ikiwiki-plugins` and is short enough to be quoted
25 <!-- don't copy/paste from here, clone the git or copy/paste from the ikiwiki rendered version, i had to scape [ -->
28 # Ikiwiki "user_in_page" pagespec
30 # The pagespec user_in_page(some_page) returns success if the currently logged
31 # in user is mentioned in a wikilink on some_page (which might be relative to
32 # the currently active page, which allows per-directory restrictions).
34 # To be precise, the string \[[${USERNAME}]] has to be present in the some_page
37 package IkiWiki::Plugin::user_in_page;
39 package IkiWiki::PageSpec;
41 sub match_user_in_page ($$;@) {
43 my $userlistpage=shift;
45 my $user=$params{user};
47 # this is relative to page, but this is intentional
48 my $userlistpagename = IkiWiki::bestlink($page, $userlistpage);
50 # FIXME: pagesources seems not to be defined in do=edit
51 my $userlistpagefile = "$userlistpagename/index.mdwn";
53 my $userlistpagedata = IkiWiki::readfile(IkiWiki::srcfile($userlistpagefile));
55 if ($userlistpagedata =~ /\Q\[[$user]]\E/ ) {
56 return IkiWiki::SuccessReason->new("User $user is listed in $userlistpagename");
58 return IkiWiki::FailReason->new("User $user is not listed in $userlistpagename");
64 before i complete this as a proposed plugin, i'd like to know
66 * if you have better ideas to check for the delimited user name than the
69 * i had to manually expand `$pagename` to `$pagename/index.mdwn` as
70 %pagesources seems to be empty in the context of `?do=edit`. how is this
75 > Just for the record, this seems to be a special case of [[todo/per_page_ACLs/]]. -- [[anarcat]]