Hi Carl,
i have just committed a small experimental enhancement to xowiki 0.36. The new ::xowiki::policy3
allows for checking of individual pages (policy 1 and 2 check only rights on the package). When policy 3 is activated the admin page shows an additional column for managing permissions of individual pages. The aggregating views don't evaluate the
permissions for the time being.
This approach is already fine for protecting individual pages (prohibiting edits, no problems with aggregations), but i am not sure whether this is the right approach to hide e.g. work in progress. Permission checking is quite expensive in openacs. Checking on the package level scales much better, since this is much better for caching, when many user and many pages are involved. Checking on instance level needs a space of packages * users * privileges
. For checking on instance level, the needed space is much larger (objects * users * privileges
). Furthermore, caching does not work well, since the probability that the same user e.g. reads the same object twice in a session is much smaller the that the same user reads two different objects form the same package in a session.
In learn@wu, we are using an "active" flag, which hides pages from non-admins. This flag can be efficiently checked in all sql queries with more or less no extra cost.
Btw, the policy manager allows as well to use for certain operations on certain pages mixed kinds of checking. Depending on the object type or a predicate satisfiable from the page instance one can use for certain operations package level or instance level checking.
Below is for reference policy3. It differs from policy2 essentially by using the attribute item_id instead of package_id for checking. It can be activated form the package parameter page (conveniently reachable from the admin pages).
best regards
-gustaf
Policy policy3 -contains {
#
# we require side wide admin rights for deletions
# we perform checking on item_ids for pages.
#
Class Package -array set require_permission {
reindex {{id admin}}
rss none
delete swa
edit-new {{{has_class ::xowiki::Object} id admin} {id create}}
}
Class Page -array set require_permission {
view {{item_id read}}
revisions {{item_id write}}
edit {{item_id write}}
make-live-revision {{item_id write}}
delete-revision swa
delete swa
save-tags login
popular-tags login
}
Class Object -array set require_permission {
edit {{package_id admin}}
}
Class File -array set require_permission {
download {{package_id read}}
}
}