Subject | Re: Why can I login into a db with a role I have never been granted? |
---|---|
Author | meier3342 <meier3342@yahoo.de> |
Post date | 2003-02-06T17:06:12Z |
> Just a short note - this should work too:The solution above seems ambiguous: As a workaround I now use the
>
> rdb$user_privileges where rdb$user = CURRENT_USER
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