Security: User vs Group

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have found it very useful to setup different switchboards for different
groups, i.e. Purchasing, Production, Engineering, etc., and it keeps the
confussion down.
However, the autoexec file is very large, with every (current user) being
directed to their correct switchboard.
Is there a way I can make it so (current users group) instead of (current
user) will direct them to the correct switchboard? This would cut down the
size and I wouldn't have to make changes to the autoexec every time someone
is hired of fired.
Thanks for any help you can give... Dale, working with 97
 
How are you determining Group membership? Are you using the builtin User
Level Security? What code are you now using to direct users to their correct
switchboard?
 
Sorry Scott it took so long to reply,
I'm currently using User Level security (letting them sign in with their
name and password), but i'm only controlling the security of the groups they
are in. The users themselves have no permissions, but the individual groups
they are in do have permissions.
 
Oh, and the autoexec code is very simple...
[CurrentUser]="Joe Smith" - OpenForm (+Switchboard-Engineering)

Thanks...
 
Are all users members of only one group? If so, this function (borrowed in
part from the MS Access Security FAQ
http://support.microsoft.com/?scid=http://support.microsoft.com/support/access/content/secfaq.asp)
can tell you the name of the Group

Function faq_ListGroupsOfUser (strUserName As String)
Dim ws As WorkSpace
Dim usr As User
Dim i As Integer

Set ws = DBEngine.Workspaces(0)
Set usr = ws.Users(strUserName)
For i = 0 To usr.Groups.count - 1
If usr.Groups(i).Name <> "Users" Then
faq_ListGroupsOfUser = usr.Groups(i).Name
Exit For
End If
Next i
End Function

If users can belong to more than one group, you'd have to alter this
somewhat.

Note that if you're doing this via the AutoExec macro, I'm not sure how
you'll be able to implement this. Instead, you could set your database to
use a Startup Form (Tools - Startup) and run this code in that form's Open
event. In that case, you could use a Select Case structure:

Select Case faq_ListGroupsOfUser(CurrentUser)
Case "Engineering"
DoCmd.OpenForm "EngineeringSwitchBoard"
Case "Administrative"
DoCmd.OpenForm "AdminSwitchboard"
Case Else
End Select

Dale said:
Oh, and the autoexec code is very simple...
[CurrentUser]="Joe Smith" - OpenForm (+Switchboard-Engineering)

Thanks...

Dale said:
Sorry Scott it took so long to reply,
I'm currently using User Level security (letting them sign in with their
name and password), but i'm only controlling the security of the groups they
are in. The users themselves have no permissions, but the individual groups
they are in do have permissions.
 
Each person is a member of one of the following groups, but not more then
one...
Purchasing, Marketing, Production, Engineering, Quality, HODs

I set Startup to run the autoexec file, then based on who they are it opens
the right switchboard for them. I just want to be able to open the correct
switchboard on which group they are in, instead of their name. Can this be
done with a macro, or should the autoexec run some sort of module instead?

Thanks for your help Scott.

Scott McDaniel said:
Are all users members of only one group? If so, this function (borrowed in
part from the MS Access Security FAQ
http://support.microsoft.com/?scid=http://support.microsoft.com/support/access/content/secfaq.asp)
can tell you the name of the Group

Function faq_ListGroupsOfUser (strUserName As String)
Dim ws As WorkSpace
Dim usr As User
Dim i As Integer

Set ws = DBEngine.Workspaces(0)
Set usr = ws.Users(strUserName)
For i = 0 To usr.Groups.count - 1
If usr.Groups(i).Name <> "Users" Then
faq_ListGroupsOfUser = usr.Groups(i).Name
Exit For
End If
Next i
End Function

If users can belong to more than one group, you'd have to alter this
somewhat.

Note that if you're doing this via the AutoExec macro, I'm not sure how
you'll be able to implement this. Instead, you could set your database to
use a Startup Form (Tools - Startup) and run this code in that form's Open
event. In that case, you could use a Select Case structure:

Select Case faq_ListGroupsOfUser(CurrentUser)
Case "Engineering"
DoCmd.OpenForm "EngineeringSwitchBoard"
Case "Administrative"
DoCmd.OpenForm "AdminSwitchboard"
Case Else
End Select

Dale said:
Oh, and the autoexec code is very simple...
[CurrentUser]="Joe Smith" - OpenForm (+Switchboard-Engineering)

Thanks...

Dale said:
Sorry Scott it took so long to reply,
I'm currently using User Level security (letting them sign in with their
name and password), but i'm only controlling the security of the groups they
are in. The users themselves have no permissions, but the individual groups
they are in do have permissions.

:

How are you determining Group membership? Are you using the builtin User
Level Security? What code are you now using to direct users to their correct
switchboard?

Hi,
I have found it very useful to setup different switchboards for different
groups, i.e. Purchasing, Production, Engineering, etc., and it keeps the
confussion down.
However, the autoexec file is very large, with every (current user) being
directed to their correct switchboard.
Is there a way I can make it so (current users group) instead of (current
user) will direct them to the correct switchboard? This would cut down the
size and I wouldn't have to make changes to the autoexec every time
someone
is hired of fired.
Thanks for any help you can give... Dale, working with 97
 
Back
Top