xo::db::CrItem instproc privilege=creator (public)

 <instance of xo::db::CrItem[i]> privilege=creator [ -login login ] \
    user_id package_id method

Defined in /var/www/openacs.org/packages/xotcl-core/tcl/cr-procs.tcl

Define an object specific privilege to be used in the policies. Grant access to a content item for the creator (creation_user) of the item, and for the package admin.

Switches:
-login (optional, defaults to "true")
Parameters:
user_id (required)
package_id (required)
method (required)

Testcases:
No testcase defined.
Source code:
set allowed 0
# :log "--checking privilege [self args]"
if {[info exists :creation_user]} {
  if {${:creation_user} == $user_id} {
    set allowed 1
  } else {
    # allow the package admin always access
    set allowed [::xo::cc permission  -object_id $package_id  -party_id $user_id  -privilege admin]
  }
}
return $allowed
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: