Add Permissions, but limited Edit and Delete Permissions

travisdh

Registered User.
Local time
Today, 08:47
Joined
Jul 5, 2010
Messages
64
Hi All.

I want to be able to have a finer level of control over my database, so I thought i would create usergroups, and userlevels which would basically say if the user is in accounting, the lab, the office or otherwise and from there determine their access to each table and the tables visibility.

For example the Accounting people will need access to invoicing tables, payment status's, payments recieved and the likes and will need add, edit, remove permissions but the lab people won't need access to that.

On the other side only one or two of the lab people should have the permissions on the sample table to edit or delete samples, whilst everyone should be able to add them. That way it allows the user to generate samples, but not to modify results or samples unless they have permission

Lets say the sample table has the following fields.

ProjectID, SampleID, Parent_SampleID, Sample Description, Date Recieved

How can i set it in a form so that depending on the user, for example userlevel 4 of group "Lab" can add, edit and remove samples, Userlevel 3 can add, edit and view, and userlevel 2 can add and view but anything below userlevel 2 can only view samples.

I guess i would have the group levels as follows:

Userlevel 1 : View Access
Userlevel 2 : Add & View Access
Userlevel 3 : Add & View & Edit Access
Userlevel 4 : Add & View & Edit & Delete Access

Is there a way to see a per project permission as well, so for example if there is a confidential project, to be able to say only users x,y,z can even see this project?

How might this be achieved?
 
Try this in your forms on open event...

Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

    If CurrentUser = "Userlevel2" Then
        Me.AllowAdditions = True
        Me.AllowDeletions = False
        Me.AllowEdits = False
    ElseIf CurrentUser = "Userlevel3" Then
        Me.AllowAdditions = True
        Me.AllowDeletions = False
        Me.AllowEdits = True
    ElseIf CurrentUser = "Userlevel4" Then
        Me.AllowAdditions = True
        Me.AllowDeletions = True
        Me.AllowEdits = True
    Else
        Me.AllowAdditions = False
        Me.AllowDeletions = False
        Me.AllowEdits = False
    End If
    
Exit_Form_Open:
    Exit Sub

Err_Form_Open:
    MsgBox Err.Number & " - " & Err.Description, vbCritical, "Form_Open()"
    Resume Exit_Form_Open

End Sub
 

Users who are viewing this thread

Back
Top Bottom