Subject Re: [firebird-support] Secure DB only for the owner.
Author Milan Babuskov
Fidel Viegas wrote:
>> Is there a way by which i can restrict my DB connection for only the owner
>> and no one else.
>
> If you are using Firebird 2.1+, then you can use database triggers to
> achieve that.

There's an example of a similar trigger here:

http://www.firebirdfaq.org/faq344

Basically, you check the CURRENT_USER and throw an exception to prevent
connecting. Something like:


if (not exists(
SELECT 1
FROM RDB$RELATIONS a
WHERE a.RDB$RELATION_NAME = 'RDB$DATABASE'
and a.RDB$OWNER_NAME = current_user))
then
exception disallow 'Only owner can connect';


--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com