auth::authority::edit (public)
auth::authority::edit -authority_id authority_id -array array
Defined in packages/acs-authentication/tcl/authority-procs.tcl
Edit info about an authority. Note that there's no checking that the columns you name exist.
- Switches:
- -authority_id (required)
- The authority you want to get.
- -array (required)
- Name of an array with column values to update.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- auth_authority_api, auth_authority_edit
Source code: # We need this to flush the cache later set old_short_name [get_element -authority_id $authority_id -element short_name] upvar $array row set names [array names row] # Construct clauses for the update statement set set_clauses [list] foreach name $names { lappend set_clauses "$name = :$name" } if { [llength $set_clauses] == 0 } { # No rows to update return } set columns [get_columns] # Check that the columns provided in the array are all valid # Set array entries as local variables foreach name $names { if {$name ni $columns} { error "Attribute '$name' isn't valid for auth_authorities." } if {$name eq "authority_id"} { error "Attribute '$name' is the primary key for auth_authorities, and thus cannot be edited." } set $name $row($name) } db_dml update_authority " update auth_authorities set [join $set_clauses ", "] where authority_id = :authority_id " get_flush -authority_id $authority_id get_id_flush -short_name $old_short_name # check if we need to update the object title set new_short_name [get_element -authority_id $authority_id -element short_name] if {$old_short_name ne $new_short_name } { db_dml update_object_title {} }Generic XQL file: <fullquery name="auth::authority::edit.update_object_title"> <querytext> update acs_objects set title = :new_short_name where object_id = :authority_id </querytext> </fullquery>packages/acs-authentication/tcl/authority-procs.xql
PostgreSQL XQL file: packages/acs-authentication/tcl/authority-procs-postgresql.xql
Oracle XQL file: packages/acs-authentication/tcl/authority-procs-oracle.xql