简体   繁体   English

使用C#的系统中基于角色的访问控制

[英]Role-based accesses control in a system using c#

I'm creating a restaurant management system, I want to enable or disable some buttons according to the user type. 我正在创建一个餐厅管理系统,我想根据用户类型启用或禁用某些按钮

For example, if the user have admin type account then Edit salary button is enabled; 例如,如果用户具有admin类型的帐户,则启用“ Edit salary按钮; if the user does not have admin rights then the button should be disabled. 如果用户没有admin权限,则应禁用该按钮。

I created two tables using sql. 我使用sql创建了两个表。 First one is USER and it have( Username , Password and UserTypeID columns), and the other table has( UserTypeID and Usertype ). 第一个是USER ,它具有( UsernamePasswordUserTypeID列),另一个表是USERUserTypeIDUsertype )。

How can I do this? 我怎样才能做到这一点? Is there any other way to do? 还有其他方法吗?

If you're using Java and Spring take a look at Spring Security. 如果您使用Java和Spring,请查看Spring Security。 Their DSL features and tag libraries should be able to help 他们的DSL功能和标签库应该能够提供帮助

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

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