[CDBI] Trigger - cancel transaction.

Michael Peters mpeters at plusthree.com
Sun Mar 26 00:37:02 GMT 2006



Praveen Hombaiah wrote:
> 
> Hi,
>   I'm wanting to check if a user has rights to create an object(Insert
> it into the db ).   An idea I have is to check it with a before_create
> trigger.  My question is how can I stop the object from being created
> from the before_create trigger( without using die in the trigger, which
> means the users of the class will have to eval{} all methods to the class.

I don't think you can do it in a trigger. Try overriding create() itself
(and probably update() too).

-- 
Michael Peters
Developer
Plus Three, LP





More information about the ClassDBI mailing list