Subject | Re: [firebird-support] Secure DB only for the owner. |
---|---|
Author | Milan Babuskov |
Post date | 2009-06-15T09:55:23Z |
Fidel Viegas wrote:
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
>> Is there a way by which i can restrict my DB connection for only the ownerThere's an example of a similar trigger here:
>> and no one else.
>
> If you are using Firebird 2.1+, then you can use database triggers to
> achieve that.
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