Hello. I want to integrate roles and permissions for a specific operator after they log in. Is there a way to handle this. If so please ldt me know and ill give more details. Please answer. Thanks. Ryno
How to show available forms and controls for a specific operator after login?
Collapse
X
-
Tags: None
-
Ok. Do you maybe have a sample databare how you did it. My goal is to set up a list of roles an then tick them off which access the user has.Comment
-
Sadly I can't provide any samples because I did them for work, but I can give a clearer explanation. So I have a table Users with the following fields.
NetworkName, FullName, Role
When the User launches the application on the first form they see in the On Open event I run a query similar to this one.
Select FullName, Role FROM Users where NetworkName = '" & Environ("UserNa me") & "'";
If they don't exist in the Users table then I kick them out of the application and tell them to contact me.
On the first form I have two hidden text boxes called tbFullName and tbRole. Once I have gotten the result of the query I load these text boxes up with the information. This first form stays open the entire life of the application so any time I need to check their role I just check the text box and see what it is.
Hope this helps.Comment
-
Ok, so is there certain buttons that they cant use if they dont have access to it. For e.g. In a purchase order, if they are a buyer, they can create a p/o and if there is a button to approve the po its disabled because only a manager can approve orders. Do you understand where im coming from. I want to grant users different access.Comment
-
In that situation I would have some code in the Forms on Open event like this. I am assuming the names of your roles and your buttons
Code:If(Forms!frm_MainMenu.tbRole = "Manager") Then me.btnApprove.Enabled = true Else me.btnApprove.Enabled = false End ifComment
-
Can you maybe attach a sample database? I need to see this practically to understand it. Please. ThanksComment
Comment