Subject Re: Why can I login into a db with a role I have never been granted?
Author meier3342 <meier3342@yahoo.de>
> Just a short note - this should work too:
>
> rdb$user_privileges where rdb$user = CURRENT_USER

The solution above seems ambiguous: As a workaround I now use the
following query issued from my java program:

SELECT COUNT(*) FROM rdb$user_privileges
WHERE rdb$user = CURRENT_USER
AND rdb$privilege = 'M'
AND rdb$relation_name = CURRENT_ROLE;

If it returns '0' the current user is no member of the current role.
In case you use the above query, do NOT check against "... == 1",
check against "... != 0": As I understand things there can be more
than one record if the user has been granted the role by more than one
grantor!

I still consider this a firebird bug though! Any comments?

Regards,

Timo