Role or db user of an active directory user (server login)

  • Hello everybody...

    I hope this is the correct forum for my question :unsure:

    I already google'd many hours about this problem but can't find any solution.

    Maybe someone of you can help me with some infos...

    I have an application (Borland Delphi) which connects to the database over ODBC.

    This application is for the most users just a viewer application (archive application for an old, replaced db application), but some few users can make changes in it.

    For this I have 2 groups in active directory (pm_read and pm_write).

    On the server I have created 2 local groups in which I inserted the domain groups and also created 2 logins for these local groups.

    In the database itself I added 2 users (pmuser -> writer and pmreader -> reader) which are mapped to the created logins and are members of the default roles db_datawriter and db_datareader.

    The access with these permissions works fine but the challange comes now...

    In the application I have a button to make some changes in the database.

    I want that only the users with the db_datawriter permissions can see this button.

    So I need to identify in which role a user is member...

    I read a lot about user_name, suser_name, execute as and so on, but nothing of this helps 🙁

    I know that my user comes through the domain group -> local group -> server login -> database user to the database but I always see my <domain>\<username> when I use user_name or suser_name and so on...

    Is there really no way to identify which role or username or maybe login this <domain>\<username> uses to connects to the database??

    I hope anyone can help me with some informations...

    Any help is very appreciated!

    Thanks in advance for any help

    Raphael

  • Did you have a look at select is_member( 'yourdbgroup' ) ?

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data and code to get the best help

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Ohhhh!!! Thank you very, very much for the very fast help!!

    That's exaclty what I searched for 🙂 🙂 🙂 🙂 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply