Access Rights

Merdok

Nerd
Local time
Today, 23:40
Joined
Jul 10, 2003
Messages
52
Hi guys,

I've just implemented the security measures mentioned here:

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=51378&highlight=security

It works great and I'm all sorted, however how do I assign a security level to a form/field also is it possible to hide buttons to people with a low access level.

My security specs are as follows:

255 - SysOp (Me & any managers who I trust not to mess things up)(so just me then)
150 - Upper Management
100 - Sales/Technical Staff
50 - Accounts Staff
10 - Anyone Else

255 should have access to everything and be the equivelent of the development environment without having to hold down shift

150 should have read/write access to everything but not be able to access the development evironment

100 should be able to access the relevent forms and have read/write access to those forms only.

50 - should have read only access to sales/technical information and read write access to accounts

10 - Can only a limited number of forms


I think I can manage the bottom one and although the 255 access level would be nice its not absolutely nessesary but if anyone knows how then that would be great.

Thanks guys.

Alex.
 
I'm not sure which security measure you set up as the link you referenced gives a few different examples and links to other posts with even more examples but.... For the example I posted (and this should work for the others as well)add a security level field to the users info tables (the example I posted already had this field). Make this a numeric field (so you can use the numbers you posted) then simply reference this info on the 'On Load' event of your forms - for those instances where you don't want users to see/have access to buttons simply hide these controls if the users level is lower than it should be or on the 'On Click' event for opening forms check the user's security level before you run the event - if it is too low or you don't want them to be able to open the forms then simply exit the sub without running it and pop a message box telling the user they don't have access. For instances where you want to have read only forms you can toggle the control/form locked and enabled properties on and off depending on the users level...

If you are working with a split db that resides on a server then you can us NT groups to limit read/write access OR if you are working with a SQL Server/Oracle/DB2/etc backend you can use the server roles and permissions to allow/deny/grant access....

HTH,
Kev
 
Any Chance of a code example cos I'm just not good enough to figure it out for myself.

Also as a side note... is it possible to add the username field as a label to other forms. Ie have a bit of text on other forms saying you are logged on as [username]

And I think it is your example I am using.
 
If you are using the example I posted then you can use code like this to do the functions I described above (this one doesn't allow a users to open the form frmUserMgmt:

---------------------------------------------------
Dim accesslv
accesslv = DLookup("[LastloginsecurityLV]", "tblSystem", "[SysID]=1")

If accesslv < 2 Then
MsgBox "You are not authorized to view this information!", vbOKOnly + vbCritical, "Authorized Users Only"
exit sub
else
DoCmd.OpenForm "frmUserMgmt"
End If
----------------------------------------------------

To reference the current user on a form create an unbound text box and as the control source put this:
-----------------------------------------------------

=DLookUp("[LastLoggedIn]","tblSystem","[SysID]=1")

-----------------------------------------------------

Also Note* The example I provided in that post was for someone looking to restrict access to a few db objects of a handful of users who were not very computer savy and the info was not of a critical nature --- so this example worked fine for his needs -- if you are along the same lines as this then my example should work fine for what you are trying to accomplish and you can do a few other things to tighten it up a bit (disable shift bypass key, hide db window/objects/password protect backend, etc..) IF you need an absolutely secure system then I would have to suggest splitting the db and move to a more robust db backend (like SQL Server) which has stronger security measures or implementing User-Level Security that comes with MS Access and going from there...

HTH,
Kev
 
cheers for that.... I'll try that after my dinner.

I dont need to worry about advanced security, your signature would cover every other member of staff here! :)
 
Excellent. That works like a dream! :)

Shame its a dream about logging into access forms and not about Christina Aguilera.
 
Glad to help :D

Good luck with the rest of your project...

Kev
 

Users who are viewing this thread

Back
Top Bottom