public override string[] GetUsersInRole(string roleName) { var r = DbEntryRole.FindOne(CK.K["Name"] == roleName); var ls = new List <string>(); foreach (DbEntryMembershipUser u in r.Users) { ls.Add(u.UserName); } return(ls.ToArray()); }
public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) { var r = DbEntryRole.FindOne(CK.K["Name"] == roleName); if (r != null) { if (throwOnPopulatedRole && r.Users.Count > 0) { throw new DataException("This role has members."); } r.Delete(); return(true); } return(false); }
public override string[] FindUsersInRole(string roleName, string usernameToMatch) { var r = DbEntryRole.FindOne(CK.K["Name"] == roleName); if (r != null) { var ls = new List <string>(); foreach (DbEntryMembershipUser u in r.Users) { if (u.UserName.IndexOf(usernameToMatch) >= 0) { ls.Add(u.UserName); } } return(ls.ToArray()); } return(null); }
public override bool RoleExists(string roleName) { var r = DbEntryRole.FindOne(CK.K["Name"] == roleName); return(r != null); }