[Zope-DB] Updating Database Records

Charlie Clark charlie@begeistert.org
Fri, 07 Mar 2003 19:01:54 +0100


On 2003-03-07 at 18:52:39 [+0100], Asad Habib wrote:
> Hello. Does anyone know whether a Z SQL method has the permission to make 
> modifications to already existing data by using the SQL update command. I 
> am calling a Z SQL method that attempts to do this from a DTML method 
> that has a proxy role of 'manager'. However, when this Z SQL method is 
> called, Zope flags me with an error saying that I am "Unauthorized". Now, 
> when I call
> another Z SQL method from this same DTML method that inserts records into 
> the same database, everything works fine. Is there some restriction 
> against
> modifying database records in Zope? Any help would be greatly 
> appreciated. Thanks.

The short answer is: no, there is no restriction.
Any ZSQL method must use a database connection which has user and password 
details. The ZSQL method and anything that calls it can do anything in the 
database that the connection object, ie. the database user can.

I'm not sure about the need for a proxy role when calling ZSQL, this is 
only necessary when the ZSQL itself is protected.

Check your permissions and roles.

Charlie