Forum OpenACS Development: xowiki policy question

Request notifications

Posted by Michal Hanckowiak on

is it possible to get the following result in xowiki:
1. each member of a subsite can view/edit only its own xowiki pages
(such that [ad_conn user_id]==creation_user)
2. admin of a subsite can view/edit ALL xowiki pages

can it be done by a simple configuration of xowiki instance?
(may be by defining a new xowiki Policy ...?)

best regards,
Michal Hanckowiak

2: Re: xowiki policy question (response to 1)
Posted by Gustaf Neumann on
The easiest way is to create new privileges "mysubsite-user" and "mysubsite-admin". This can be achieved e.g. by defining a method with the name privilege=creator=mysubsite-user for e.g. ::xowiki::Page. The new method should return either 0 or 1 to signal if this user this predicate should be true. You have full control over what you want to check here. Then define a new policy and use the new newly defined privileges where wherever desired.

To see an example for defining a privilege, look at the method "privilege=creator" in xotcl-core/tcl/cr-procs.tcl, and look for a usage example into xowiki/tcl/package-procs.tcl at policy5, where the "creator" is used.

hope this helps
-gustaf neumann

3: Re: xowiki policy question (response to 2)
Posted by Michal Hanckowiak on
Thank you!