本文整理汇总了C#中ApplicationRoleManager类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationRoleManager类的具体用法?C# ApplicationRoleManager怎么用?C# ApplicationRoleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationRoleManager类属于命名空间,在下文中一共展示了ApplicationRoleManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AccountController
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, IAuthenticationManager authenticationManager, ApplicationRoleManager roleManager)
{
this.userManager = userManager;
this.signInManager = signInManager;
this.authenticationManager = authenticationManager;
this.roleManager = roleManager;
}
开发者ID:mmoore99,项目名称:IoCIdentitySample,代码行数:7,代码来源:AccountController.cs
示例2: IdentityUnitOfWork
public IdentityUnitOfWork(string connectionString)
{
_db = new ApplicationContext(connectionString);
_userManager = new ApplicationUserManager(new UserStore<ApplicationUser>(_db));
_roleManager = new ApplicationRoleManager(new RoleStore<ApplicationRole>(_db));
_clientManager = new ClientManager(_db);
}
开发者ID:sweexxik,项目名称:Uav-Site,代码行数:7,代码来源:IdentityUnitOfWork.cs
示例3: AccountController
public AccountController(ApplicationUserManager userManager, ApplicationRoleManager roleManager,
ISecureDataFormat<AuthenticationTicket> accessTokenFormat)
{
RoleManager = roleManager;
UserManager = userManager;
AccessTokenFormat = accessTokenFormat;
}
开发者ID:adaluo,项目名称:SimonTan,代码行数:7,代码来源:AccountController.cs
示例4: IdentityModelHelper
public IdentityModelHelper(ApplicationUserManager userManager, ApplicationRoleManager roleManager)
{
Contract.Assert(null != userManager);
Contract.Assert(null != roleManager);
_userManager = userManager;
_roleManager = roleManager;
}
开发者ID:PF2000,项目名称:AppLabRedes,代码行数:7,代码来源:IdentityModelHelper.cs
示例5: UsersAdminController
public UsersAdminController(
ApplicationUserManager userManager,
ApplicationRoleManager roleManager)
{
UserManager = userManager;
RoleManager = roleManager;
}
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:UserAdminController.cs
示例6: AccountController
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager,
ApplicationRoleManager roleManager)
{
UserManager = userManager;
SignInManager = signInManager;
RoleManager = roleManager;
}
开发者ID:sthapa123,项目名称:PV247-Expense-manager,代码行数:7,代码来源:AccountController.cs
示例7: ApplicationGroupManager
public ApplicationGroupManager()
{
_db = HttpContext.Current.GetOwinContext().Get<ApplicationDbContext>();
_userManager = HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>();
_roleManager = HttpContext.Current.GetOwinContext().Get<ApplicationRoleManager>();
_groupStore = new ApplicationGroupStore(_db);
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:7,代码来源:ApplicationGroupManager.cs
示例8: CourseTemplatesController
public CourseTemplatesController(ApplicationDbContext context, ApplicationUserManager userManager,
ApplicationRoleManager roleManager)
{
_context = context;
_userManager = userManager;
_roleManager = roleManager;
}
开发者ID:rswetnam,项目名称:GoodBoating,代码行数:7,代码来源:CourseTemplatesController.cs
示例9: RolesAdminController
public RolesAdminController(ApplicationUserManager userManager,
ApplicationRoleManager roleManager,ApplicationPermissionManager perManager)
{
UserManager = userManager;
RoleManager = roleManager;
PermissionManager = perManager;
}
开发者ID:khoainv,项目名称:Framework,代码行数:7,代码来源:RolesAdminController.cs
示例10: Application_Start
protected async void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
// ユーザーとロールの初期化
// ロールの作成
var roleManager = new ApplicationRoleManager(new UserStore());
await roleManager.CreateAsync(new ApplicationRole { Name = "admin" });
await roleManager.CreateAsync(new ApplicationRole { Name = "users" });
var userManager = new ApplicationUserManager(new UserStore());
// 一般ユーザーの作成
await userManager.CreateAsync(new ApplicationUser { UserName = "tanaka" }, "[email protected]");
await userManager.AddToRoleAsync(
(await userManager.FindByNameAsync("tanaka")).Id,
"users");
// 管理者の作成
await userManager.CreateAsync(new ApplicationUser { UserName = "super_tanaka" }, "[email protected]");
await userManager.AddToRoleAsync(
(await userManager.FindByNameAsync("super_tanaka")).Id,
"users");
await userManager.AddToRoleAsync(
(await userManager.FindByNameAsync("super_tanaka")).Id,
"admin");
Debug.WriteLine("-----------");
}
开发者ID:runceel,项目名称:ASPNETIdentity,代码行数:28,代码来源:Global.asax.cs
示例11: ApplicationPermissionManager
public ApplicationPermissionManager(ApplicationDbContext context)
{
_db = context;
_userManager = new ApplicationUserManager(_db);
_roleManager = new ApplicationRoleManager(_db);
_permissionStore = new ApplicationPermissionStore(_db);
}
开发者ID:khoainv,项目名称:Framework,代码行数:7,代码来源:ApplicationPermissionManager.cs
示例12: RoleMenusController
public RoleMenusController(IRoleMenuService roleMenuService, IUnitOfWorkAsync unitOfWork, IMenuItemService menuItemService, ApplicationRoleManager roleManager)
{
_roleMenuService = roleMenuService;
_menuItemService = menuItemService;
_roleManager = roleManager;
_unitOfWork = unitOfWork;
}
开发者ID:huoxudong125,项目名称:MVC5-Scaffolder,代码行数:7,代码来源:RoleMenusController.cs
示例13: IdentityUnitOfWork
public IdentityUnitOfWork(string connectionString)
{
db = new StoreContext(connectionString);
UserManager = new ApplicationUserManager(new UserStore<ApplicationUser>(db));
RoleManager = new ApplicationRoleManager(new RoleStore<ApplicationRole>(db));
ClientManager = new ClientManager(db);
}
开发者ID:belush,项目名称:Store,代码行数:7,代码来源:IdentityUnitOfWork.cs
示例14: AuthenticationRepository
public AuthenticationRepository(IOwinContext owinContext)
{
userManager = owinContext.GetUserManager<ApplicationUserManager>();
roleManager = owinContext.Get<ApplicationRoleManager>();
authenticationManager = owinContext.Authentication;
request = owinContext.Request;
}
开发者ID:CuongDuongDuy,项目名称:SecuredToDoList,代码行数:7,代码来源:AuthenticationRepository.cs
示例15: CreateRole
public bool CreateRole(string name)
{
var rm = new ApplicationRoleManager(
new RoleStore<IdentityRole>(context));
var idResult = rm.Create(new IdentityRole(name));
return idResult.Succeeded;
}
开发者ID:BenVandenberk,项目名称:EindwerkNET,代码行数:7,代码来源:IdentityModels.cs
示例16: CreateNewRole
public void CreateNewRole(Role model)
{
ApplicationRoleManager rm = new ApplicationRoleManager(new ApplicationRoleStore(new ApplicationDbContext()));
rm.Create(new ApplicationRole(model.Name)
{
Id = Guid.NewGuid().ToString()
});
}
开发者ID:hurtonypeter,项目名称:onlab,代码行数:8,代码来源:PerseusRepository.cs
示例17: RoleService
public RoleService(ApplicationRoleManager roleManager, ApplicationUserManager userManager) {
logger.Info("Start");
this.roleManager = roleManager;
logger.Debug("roleManager: {0}", roleManager);
this.userManager = userManager;
logger.Debug("userManager: {0}", userManager);
logger.Info("End");
}
开发者ID:SergeySorokin,项目名称:FurnitureStore,代码行数:8,代码来源:RoleService.cs
示例18: AccountController
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager,
ApplicationDbContext dbContext)
{
UserManager = userManager;
SignInManager = signInManager;
RoleManager = roleManager;
AppDbContext = dbContext;
}
开发者ID:AntonHuang,项目名称:WebAppEF6,代码行数:8,代码来源:AccountController.cs
示例19: GetCourseAuthors
public static IEnumerable<ApplicationUser> GetCourseAuthors(ApplicationRoleManager roleManager, ApplicationUserManager userManager)
{
var role = roleManager.Roles.FirstOrDefault(r => r.Name == "Course Author");
var roleId = role.Id;
var users = userManager.Users.ToList();
var courseAuthors = users.Where(x => x.Roles.Select(r => r.RoleId).Contains(roleId)).OrderBy(u=>u.LfName);
return courseAuthors;
}
开发者ID:rswetnam,项目名称:GoodBoating,代码行数:9,代码来源:RolesService.cs
示例20: ProfileController
public ProfileController()
{
roleManager = HttpContext.Current.GetOwinContext().Get<ApplicationRoleManager>();
userManager = HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>();
objectProvider = objectProvider == null ? new ObjectProvider() : objectProvider;
unitOfWork = unitOfWork == null ? objectProvider.UnitOfWork : unitOfWork;
aspNetUsersRepository = aspNetUsersRepository == null ? unitOfWork.AspNetUserRepository : aspNetUsersRepository;
}
开发者ID:buddhika85,项目名称:Stage7_UserLogin,代码行数:9,代码来源:ProfileController.cs
注:本文中的ApplicationRoleManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论