-
creating permissions
i created a module storing my logged in user's Login ID (gintLoginID). this information will be passed around when in need. Now i'm currently in another form and this form contains a few buttons namely, Add, Edit and Delete. All users are given a role Entry, Update, View.
is it possible for me to check using gintLoginID the role of the logged in user?
i want to make buttons available for certain users. eg. Entry role has add, edit and delete. Update role has edit and delete. View role has none.
is it possible? please help
-
Re: creating permissions
yes, it's possible.
You need a table storing available options for a given user, then on form load query the table with the user id to find their permissions then set buttons etc accordingly.
-
Re: creating permissions
I pass the Permissions of the user,after confirmed login, to a Global defined Array of Boolean type (In a module)...
then throughout me code if i need to check the permitions or access rights i use..
Code:
Private Form_Load ()
Frm.Tool_Acc.Enabled = Acc(8) 'Set Menu rights to user..
Frm.Tool_Print.Enabled = Acc(9)
Frm.Tool_Staff.Enabled = Acc(6)
Frm.Tool_Supp.Enabled = Acc(7)
Frm.Tool_User.Enabled = Acc(10)
Frm.Main_Func.Enabled = Acc(3)
Frm.Main_Paym.Enabled = Acc(4)
Frm.Main_Shift.Enabled = Acc(2)
Frm.Main_With.Enabled = Acc(5)
End Sub
-----AND------
Private Sub Cmd1_Click ()
if Acc(1) then
.........
end if
end sub
----EDIT----
to use more that one access we use
Code:
if Acc(1) and Acc(2) then ' user must have View and Edit rights to do function
if Acc(1) or Acc(3) then ' user can have View or Print rights to do function
----- END EDIT-----
Hope This helps you..
Gremmy