Forum OpenACS Q&A: Re: myfirstpackage: ERROR: duplicate key violates unique constraint

Hi. There is another error someone may run into later on while following the myfirstpackage tutorial. It took me a while to understand what was wrong with it:
Further down at the admin pages section(Advanced topics), you are supposed to add an admin section to the myfirstpackage:

look into the file: index.tcl (admin folder)

ad_page_contract {} {
} -properties {
context_bar
}

set package_id [ad_conn package_id]

permission::require_permission \
-object_id $package_id \
-privilege admin]

set context [list]

set title "Administration"

set parameters_url [export_vars -base "/shared/parameters" {
package_id { return_url [ad_return_url] }
}]

Please look at the permission section. The bracket after
admin should go. This creates problems 'cause the -privilege is not "admin" but "admin]". Most likely the bracket was left there by mistake.

Hope this helps too.

I am sorry, I have to correct myself too:
The privilege should be "admin" and not "admin]"

code should be:
permission::require_permission \
-object_id $package_id \
-privilege admin