访问控制使用用户权限和放大器;组放大器、访问控制、用户权限

2023-09-09 21:25:29 作者:只谈情不闲聊

我有一个使用MS Access 2007中从头构建与运行VBA窗体,报表和数据表之间的所有脚本攻击(SQL,数据验证等)的数据库。我试图把用户访问实现系统数据库的登录页面上。用户可以在1 3组,管理员(进入系统设置,用户管理),一个军官(职位数据),经理(视图中的数据)。 用户被链接到用户组表,它具有以下

I have a database that is built from the ground up using MS Access 2007 with VBA running all the scripting (SQL, data validation etc) between the forms, reports and the data tables. I am trying to put a user access implementation system on the database's landing page. The users can be 1 of 3 groups, an admin(enters system settings, user management), an officer(posts data) or a manager(views data). Users are linked to a user group table which has the following:

ID    UserGroupDescription HideOps  HideAdmin HideManager  
1     Administrator          TRUE    FALSE       TRUE  
2     Operations            FALSE    TRUE        TRUE  
3     Manager                TRUE    TRUE        FALSE  

我想告诉每个小组只有自己的快捷方式(使用标签的。可见性)的登陆页面上,但我被困在如何管理仰视这个数据没有硬编码的3组只能在一个case语句(这意味着我有任何C其他组$ C $添加)。 有没有一种方法,使这些标签,以显示动态检查?在使用SQL用户用户组的方式。

I would like to show each group their shortcut only(using a label's .visible property) on the landing page but I am stuck on how to manage the looking up of this data without hardcoding the 3 groups only in a case statement (meaning I have code any additional groups being added). Is there a way to make the checking of which label to show dynamic? while using the sql user user group approach.

推荐答案

在登陆页面表单的Form Load事件中,打开一个 DAO.Recordset 的基础上的查询 USER_GROUP 表。然后使用记录集的 HideOps HideAdmin HideManager 值调整这些表单控件的Visible属性。

In the landing page form's Form Load event, open a DAO.Recordset based on a query of the user_group table. Then use the recordset's HideOps, HideAdmin, and HideManager values to adjust the Visible properties of those form controls.