Forum OpenACS Development: Re: xowiki 0.47

Collapse
23: Re: xowiki 0.47 (response to 2)
Posted by Byron Linares on
Hi. Gustaf

I have troubles with xowiki 0.47
I trying to set a new policy that Works for me
I want that only site Wide admin. Cant create a xowiki::Object and ::xowiki::PageTemplate
And only site Wide admin. Cant do programmatical operations

For example with ::xowiki::Object in try this code

In Class Package -array set require_permission {

edit-new {{{has_class ::xowiki::Object} id swa} {id create}}

but get this when I try to create a xowiki::Object

::47934064: unable to dispatch method 'name'
while executing
"$object name"
("default" arm line 19)
invoked from within
"switch $permission {
none {set allowed 1; break}
login {auth::require_login; set allowed 1; break}
swa {
..."
(procedure "check_permissions" line 12)
::xowiki::policyb ::xowiki::Policy->check_permissions
invoked from within
"$policy check_permissions $object $method"
(procedure "call" line 5)
::47934064 ::xowiki::Package->call
invoked from within
"my call $page $method"
(procedure "invoke" line 8)
::47934064 ::xowiki::Package->invoke
invoked from within
"::$package_id invoke -method $m"
invoked from within
"::$package_id reply_to_user [::$package_id invoke -method $m]"
(file "/Users/byronharoldolinaresroman/www/ges2wiki/packages/xowiki/www/index.vuh" line 21)
invoked from within
"source [ad_conn file]"
(procedure "rp_handle_tcl_request" line 3)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info..."

if y try this code
In Class Package -array set require_permission {
edit-new {{{has_class ::xowiki::Object} swa} {id create}}

I get this error when I try to create any kind of page
can't read "has_class ::xowiki::Object": no such variable
::47934064 ::xotcl::Object->set
invoked from within
"$object set $attribute"
("default" arm line 13)
invoked from within
"switch $permission {
none {set allowed 1; break}
login {auth::require_login; set allowed 1; break}
swa {
..."
(procedure "check_permissions" line 12)
::xowiki::policyb ::xowiki::Policy->check_permissions
invoked from within
"$policy check_permissions $object $method"
(procedure "call" line 5)
::47934064 ::xowiki::Package->call
invoked from within
"my call $page $method"
(procedure "invoke" line 8)
::47934064 ::xowiki::Package->invoke
invoked from within
"::$package_id invoke -method $m"
invoked from within
"::$package_id reply_to_user [::$package_id invoke -method $m]"
(file "/Users/byronharoldolinaresroman/www/ges2wiki/packages/xowiki/www/index.vuh" line 21)
invoked from within
"source [ad_conn file]"
(procedure "rp_handle_tcl_request" line 3)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info..."

Thanks for you help

Collapse
24: Re: xowiki 0.47 (response to 23)
Posted by Gustaf Neumann on
In order to allow only side wide administrators to edit ::xowiki::Object, you can simply use ::xowiki::policy2 instead of ::xowiki::policy1. The policy is a package parameter (called security_policy), so there is no need to edit the source files for such a feature.

For more details, see http://alice.wu-wien.ac.at:8000/xowiki-doc/#security-management

Collapse
25: Re: xowiki 0.47 (response to 24)
Posted by Byron Linares on
I am writing a new policy for my instance of xowiki
I want that only site Wide admin Can Create a ::xowiki::PageTemplate
And xowiki::Object but policy2 only cover the edit part,
In my policy I am try set permission for create this object like this

Policy policyb -contains {

Class Package -array set require_permission {
reindex swa
rss swa
google-sitemap none
google-sitemapindex none
delete {{id admin}}
edit-new {{{has_class ::xowiki::Object} swa} {id create}}
}
.
.
.
.

when I change the security_policy parameter and set my new policy I get and error that i describe in a previous post

https://openacs.org/forums/message-view?message_id=1048796

my question is how can I restrict the creation or edit-new for only site Wide admin for this tow (a ::xowiki::PageTemplate And xowiki::Object)

Other question is :
There is a way for page ordering in wiki 0.47
I have set the parameter display_page_order and fill the section field in creations forms but I can figured a way to order those pages
in the xowiki side menu

thack for you help.

Byron

Collapse
26: Re: xowiki 0.47 (response to 25)
Posted by Gustaf Neumann on
The relevant line in the policy should read

edit-new {{{has_class ::xowiki::Object} swa} {{has_class ::xowiki::PageTemplate} swa} {id create}}

This works with the current versions of xowiki. If you get still an error with this definition, upgrade to a slightly newer version (0.48, version of March 10) where i refactored much of the policy stuff (update both, xowiki and xotcl-core to the version of the same day).

Concerning your question about page ordering: i assume, you have in the edit form the entry field and you provided some values for this. Simply type in the URL .../xowiki/book and you get the pages displayed (book is a prototype page, which is created on demand from the filesystem and is inserted into the content repository where you can edit it etc for every instance).

I have started to make an FAQ about xowiki: http://alice.wu-wien.ac.at:8000/xowiki-faq/

maybe this helps to answer some of the questions.

Collapse
27: Re: xowiki 0.47 (response to 26)
Posted by Byron Linares on
thacks gustaf,
the upgrade worcks for the policy part.