public override bool IsUserInRole(string username, string roleName)
{
using (var session = _documentStore.OpenSession())
{
var user = session.Query<User, Users_ByApplicationNameAndUsername>()
.SingleOrDefault(x => x.ApplicationName == ApplicationName && x.Username == username);
return user != null && user.Roles.Contains(roleName);
}
}