public override bool RoleExists(string roleName) { var bll = new SiteRoles(); var model = bll.GetModel(roleName); return(model != null); }
public override void AddUsersToRoles(string[] usernames, string[] roleNames) { var uBll = new SiteUsers(); var rBll = new SiteRoles(); var urBll = new UsersInRoles(); foreach (var uItem in usernames) { var uInfo = uBll.GetModel(uItem); foreach (var rItem in roleNames) { var rInfo = rBll.GetModel(rItem); var urInfo = new UsersInRolesInfo(uInfo.Id, rInfo.Id); urBll.Insert(urInfo); } } }