基于角色的授权 [英] Role based Authorization

查看:76
本文介绍了基于角色的授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
我想将基于角色的授权和身份验证与通过编码使用sql Server作为数据库一起使用,但不使用网站管理工具/在内置登录控件(API)中使用.是他们的任何方式.

谢谢您

sir ,
I want to use Role based Authorization and Authentication with using sql server as database through coding, but without using Website Administration Tools/in build login controls (API). Is their any way .

Thanking You

推荐答案

给定的链接可能会对您有所帮助
表单身份验证和基于角色的授权:更快,更简单和正确的方法 [ ^ ]
基于角色的授权 [ http://msdn.microsoft.com/en-us/library/ms178329.aspx [ ^ ]
如何:使用表单身份验证实施基于角色的授权 [
The given links might help you
Forms Authentication and Role based Authorization: A Quicker, Simpler, and Correct Approach[^]
Role-Based Authorization [^]
http://msdn.microsoft.com/en-us/library/ms178329.aspx[^]
HOW TO: Implement Role-Based Authorization with Forms Authentication[^]


是的,我们可以做
-在SQL Server数据库中再添加一列作为角色"
-在数据库中,您手动输入一个字段
例如
User_name =超级用户"
Pass_word ="user"
地址="xyz公司"
角色=超级"
-现在获取角色值作为会话
-比较会话
-如果会话为超级",则导航到管理页面(此导航仅适用于超级用户)
-在管理页面中,选择用户,然后选择角色并进行更新.
-每次用户登录时,都会在会话中获得角色",并根据角色"进行身份验证(这可以通过if,else-if语句来完成).

注意:
最初,当新用户注册时,角色"必须为新".
yes we can do
--Add one more column to the SQL server database as "role"
--In database you manually enter a field
eg
User_name="Super user"
Pass_word="user"
Address="xyz Company"
Role="super"
--Now get the role value as session
--compare the session
--if the session is "Super" navigate to admin page(this navigation is only for super user)
--In the admin page you select the user and select the role and update.
--Every time when a user logged in get "role" in session and give authentication as per "role"(this you can do by if, else-if statements).

note:
Initially when a new user register''s then the "role" must be "new".


这篇关于基于角色的授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆