postgresql7.1 declare owner_id integer; begin select creation_user into owner_id from acs_objects where object_id = :pres_item_id; if (owner_id != :user_id) then PERFORM acs_permission__revoke_permission(:pres_item_id, :user_id, :privilege); end if; return 0; end;