具有用户登录名的基于角色的安全 [英] ROLE BASED SECURITY with user login

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

问题描述

大家下午好,我有点挑战.我需要基于角色的安全性的帮助,即,如果您以管理员身份登录,将可以创建新用户,而其他用户将看不到用于创建新用户的模块.

Good afternoon guys, i have a little challenge. i need help with role based security i:e if you log in as an administrator you''ll be able to create new users while other users will not be able to see the module for creating new users.

推荐答案

WindowsPrincipal principal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool isLocalAdmin = principal.IsInRole(@"BUILTIN\Administrators");


这篇关于具有用户登录名的基于角色的安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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