简体   繁体   English

C#:应用程序套件的安全性/用户权限,ldap适合吗?

[英]C#: Security / user rights for an application suite, ldap suitable?

We are developing a suite of windows applications for a client and need to add a security module. 我们正在为客户端开发一套Windows应用程序,并且需要添加安全模块。 The basic needs are fairly simple: 基本需求非常简单:
A function to return a list of permissions: 返回权限列表的函数:

string[] AllowedApplications = Security.GetList("Applications");
string[] AllowedMenusAndButtons = Security.GetList("Functions"); 
//In General:
string[] AllowedObjects = Security.GetList(<ObjectType>);

With the allowed applications we decide if the current user can start the application and AllowedMenusAndButtons we decide which buttons/menus are enabled. 使用允许的应用程序,我们确定当前用户是否可以启动该应用程序,而AllowedMenusAndButtons我们确定启用哪些按钮/菜单。 The AllowedObjects will be used for row level security on objects. AllowedObjects将用于对象的行级安全性。

For the administation of the rights we just need as simple GUI that allows users to be grouped together and the rights assigned to users or groups. 对于权限的管理,我们只需要一个简单的GUI,即可将用户分组在一起,并将权限分配给用户或组。

Is LDAP suitable for these requirements or would it be too much overhead. LDAP是否适合这些要求,否则开销太大。 Is there another framework we can use or are we better off developing it ourselves? 有没有其他可以使用的框架,还是我们自己开发更好?

A lot depends on how many number of users you have and in addition to permission management do you foresee the need of more such attributes might be required to be managed latter on? 在很大程度上取决于您拥有多少用户,除了权限管理之外,您还预见到以后可能需要管理更多此类属性吗?

If you don't have large number of users, a simple XML would do and you can use XPATH query to operate on XML easily. 如果您没有大量用户,则可以使用简单的XML,并且可以使用XPATH查询轻松地对XML进行操作。 For large number of users, LDAP sounds feasible. 对于大量用户,LDAP听起来很可行。

Btw, I am curious to know if AllowedMenusAndButtons will be used to "dispaly" menus which are valid of particular user? 顺便说一句,我很好奇是否要使用AllowedMenusAndButtons来“分发”对特定用户有效的菜单? if so, I am hoping you will be performing authorization on server level for those menus. 如果是这样,我希望您将在服务器级别上对那些菜单执行授权。 A common security bug is to display only the menus applicable and consider this as authorization. 常见的安全错误是仅显示适用的菜单,并将其视为授权。 I'm not sure if AllowedObjects is that server level authorization, if it is, you are all good. 我不确定AllowedObjects是否是服务器级别的授权,如果是,那么一切都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM