|
-
Oct 6th, 2022, 01:34 PM
#1
Thread Starter
Member
User Permissions and Form Control
I am transitioning from Access/VBA to VB.net, and this is my first real project (it is a Windows Forms Application project). I am using VS 2019 and MySQL. It is basically a custom small ERP system for tracking orders, defects, inventory, and some reports in a very niche manufacturing company. I am not sure if I am going about this correctly. I just don't know how to proceed otherwise.
I have a form for admins to be able to set permissions for users. (NOTE: The duplicate named check-boxes and labels in each section are just place holders.) Here is a partial screenshot.

In the db I have two tables: employees and permissions. The table has boolean fields for each checkbox. These tables are joined on Employee_No. I have read that it might be better to use permission groups based on roles, but then I have to create a lot of different groups to provide the level of control that I need per user.
Given my current plan/structure:
How do I apply permissions to the forms in the application? Are there Nuget packages or specific extensions for something like this? That is, allowing or disallowing certain buttons, selections, or the form in general?
Until now, I have always placed all form events (button clicks, combo box selections, etc) within the form. Basically just a lot of decision-making code with If-Thens and Select Case statements in each object event making this enabled or visible. I would like to know if this is the correct way or if there is another (correct) way. I have tried searching online but have not be able to find a definitive answer or examples of how to do this.
Any assistance would be greatly appreciated. If someone could suggest how to handle this, or a resource that has actual code or structure examples, I would be very thankful. If you need me to clarify something, please let me know.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|