Subject | Re: [firebird-support] how to determine User role |
---|---|
Author | Helen Borrie |
Post date | 2008-03-25T00:02:55Z |
At 03:06 AM 25/03/2008, you wrote:
It is not a thing that can be decided after login - it is a parameter of the actual deed of connecting to the database. As such, it has to be known before the user logs in and applied as part of the login.
You should inform the users of the user names and roles they are to use to access the database from their part of your application system. Your application needs to provide a way for the user to enter (or select) the appropriate role. Often, when an application is written for a particular purpose, and used only by users needing a certain set of privileges, the role name can be hard coded (or defaulted) into the login procedure. Or perhaps read from a disk file or (on Windows) a registry entry.
As to how you effect this, it depends entirely on the programming interface you use. Whatever driver, component set, or whatever, you use, there will be a property or parameter structure that is designed to take the role name.
./heLen
>I have three different roles and several users.Hmm, you apparently don't understand the purpose of roles. A role is a package of permissions. Once the package is set up, then the role is granted to each user that requires those permissions.
>When a user logs in how can I determine which role to use. I realize
>the role must be set at login, but if user does not know role name when
>logging in how can I get role name(s) and then relogin using role
>appropriate role.
It is not a thing that can be decided after login - it is a parameter of the actual deed of connecting to the database. As such, it has to be known before the user logs in and applied as part of the login.
You should inform the users of the user names and roles they are to use to access the database from their part of your application system. Your application needs to provide a way for the user to enter (or select) the appropriate role. Often, when an application is written for a particular purpose, and used only by users needing a certain set of privileges, the role name can be hard coded (or defaulted) into the login procedure. Or perhaps read from a disk file or (on Windows) a registry entry.
As to how you effect this, it depends entirely on the programming interface you use. Whatever driver, component set, or whatever, you use, there will be a property or parameter structure that is designed to take the role name.
./heLen