I have been working on this database for awhile and I thought I would post it to hopefully help out anyone that needs Security/Identification for there dbs. The reason that I wrote this is access user and group security is somewhat lacking and I am not able to find out what group a user is in to work with it in my code.
I have deleted all information that pertains to my specific db's and have deleted all users etc from the security peice save two:
Admin - member of admin group
Flobob - member of user group
both use there names for a password though this is easily changed.
the attachment contains three databases:
Security.mdb - contains all the table specific to to security including users tables, group tables, and membership tables. it has a stand alone password as sort of a backdoor into the system case you lock yourself out. password is currently set to flobob.
Administration.mdb - contains some forms to make it easier to adminstrate users and there groups, this database is registered to admin and as such only a user in the admin group can open this database
Template.mdb - a default database I use to start all my access applications. it is registerd to the users group, I have registration because it allows me to use more then one db on the same security structure, so all databases have to be registered to some group.
I have built in three functions to help me with identification when I am building my db's these include:
getusername() - returns current user name
getuserid() - returns current users ID
ingroup(userid, groupname, gid) - returns a boolean value depending on if the user is in the group or not. example:
if ingroup(getuserid(), "admin", 0) = true then
msgbox "you are in admin group"
end if
also
if ingroup(getuserid(), "", 1) = true then
msgbox "you are in admin group"
end if
would work
This isnt exactly the most user friendly to administer however I find it to work quite successfully when your dealing with users especially curious ones. There are a few loopholes though you would have to be a bit access knowledgable to be able to find them, I would plug them though I do not have a solution for them at this moment.
If you have any questions please let me know. I hope that this helps atleast a few of you guys since I have gotten so much from all of you. Also if you do any work on this please post it here I would love to get feedback and/or sugjestions as to how I might make it better. Thanks!
flobob
I have deleted all information that pertains to my specific db's and have deleted all users etc from the security peice save two:
Admin - member of admin group
Flobob - member of user group
both use there names for a password though this is easily changed.
the attachment contains three databases:
Security.mdb - contains all the table specific to to security including users tables, group tables, and membership tables. it has a stand alone password as sort of a backdoor into the system case you lock yourself out. password is currently set to flobob.
Administration.mdb - contains some forms to make it easier to adminstrate users and there groups, this database is registered to admin and as such only a user in the admin group can open this database
Template.mdb - a default database I use to start all my access applications. it is registerd to the users group, I have registration because it allows me to use more then one db on the same security structure, so all databases have to be registered to some group.
I have built in three functions to help me with identification when I am building my db's these include:
getusername() - returns current user name
getuserid() - returns current users ID
ingroup(userid, groupname, gid) - returns a boolean value depending on if the user is in the group or not. example:
if ingroup(getuserid(), "admin", 0) = true then
msgbox "you are in admin group"
end if
also
if ingroup(getuserid(), "", 1) = true then
msgbox "you are in admin group"
end if
would work
This isnt exactly the most user friendly to administer however I find it to work quite successfully when your dealing with users especially curious ones. There are a few loopholes though you would have to be a bit access knowledgable to be able to find them, I would plug them though I do not have a solution for them at this moment.
If you have any questions please let me know. I hope that this helps atleast a few of you guys since I have gotten so much from all of you. Also if you do any work on this please post it here I would love to get feedback and/or sugjestions as to how I might make it better. Thanks!
flobob