用户通过admin使用sql表项访问控制 [英] user acces control by admin using sql table entry
问题描述
我有一个Web应用程序,登录从数据库工作正常,我只想知道如何设置用户访问权限是由管理员在数据库表中控制,通过对每个页面只放1或零。我有表名页面访问,id,pages列我列出所有页面,role_id是用户id ant最后一列是ACCESS TYPE是比特类型,如果admin标记为1那么具有该id的用户将访问该页面前端的菜单,对于我想要这个设置的每个用户和每个页面,
和管理员可以访问每个页面。
i have a web application, log in is working fine from database,i just want that how can i set up that user access is control by admin in the database table,by putting just 1 or zero against each page. i have table name page access, with id,pages column where i list up all pages,role_id which is user id ant last column is ACCESS TYPE which is bit type,if admin mark it 1 then user with that id will access that page on the menu of front end,for every user and every page i want this setup,
and admin has access to every page.
推荐答案
仔细阅读本文。
ASP.NET身份验证和授权 [ ^ ]
http://www.asp.net/web-forms/tutorials/security/membership/user-based-authorization-cs [< a href =http://www.asp.net/web-forms/tutorials/security/member ship / user-based-authorization-cstarget =_ blanktitle =New Window> ^ ]
Read this articles carefully.
ASP.NET authentication and authorization[^]
http://www.asp.net/web-forms/tutorials/security/membership/user-based-authorization-cs[^]
这篇关于用户通过admin使用sql表项访问控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!