admin是用户系统中自定义的脚色
用来在创建GenericPrincipal的时候用,具体用
FormsIdentity id =(FormsIdentity)app.User.Identity;
string role="admin";
if(role!=string.Empty)
{
IPrincipal principal = new GenericPrincipal(id,new string[]{role});
Context.User =principal;
}这段代码就是当前用户指定角色的,一般用在基于role的安全认证中
用来在创建GenericPrincipal的时候用,具体用
FormsIdentity id =(FormsIdentity)app.User.Identity;
string role="admin";
if(role!=string.Empty)
{
IPrincipal principal = new GenericPrincipal(id,new string[]{role});
Context.User =principal;
}这段代码就是当前用户指定角色的,一般用在基于role的安全认证中
解决方案 »
- Microsoft Visual SourceSafe服务器配置问题
- div
- datalist的问题
- 请问怎么让BulletedList的值显示2段后再换行?
- TextBox菜菜鸟问题
- 要崩溃了!关于Forms验证和Iframe的问题,百思不得奇解!
- 使用JS函数回调时 发现一个奇怪的问题
- [100分求助]提交评论出错:PageRequestManagerParserErrorException
- 如何用c#提取html中制定的内容???
- 如何实现像MIMIMA那样点下一个按扭,然后弹出下载对话框的?
- 利用asp.net框架开发时,加以用以前如vbscript或javascript语句吗?
- 水晶报表的分页问题有人回吗?
则role为admin的才可以访问这些页面