Forum OpenACS Q&A: Problems creating users

Collapse
Posted by Paul Gilbert on
I've been doing some work on an existing site, and I've been having some major troubles with a section where i need to add a new user into the system. I'm no OpenACS expert, but the site seems to be set up such that there's one main subsite; let's call it "xyzzy". It appears under the "Subsite Administration" section of ACS Admin along with the "Main Site" entry.

Using the following fragment, which I've gleaned through a search of the forums, I can create a user:

array set results [auth::create_user -email "mailto:test@xyzzy.com"; -first_names "Test" -last_name "User" -password "test"]

if {![string match $results(creation_status) "ok"]} {
return
}

set user_id $results(user_id)
permission::grant -party_id $user_id -object_id $user_id -privilege "read"
permission::grant -party_id $user_id -object_id $user_id -privilege "write"
acs_user_extension::user_new -user_id $user_id

Unfortunately, whilst the new user appears in user searching, it isn't being set as having permission to access the pages of the subsite (which contains things like the CSS and logout pages). I've been doing a lot of experimenting, and I'm completely stumped as to how to give the new user read permissions for the subsite.

Thanks for any help.