and many to many links between these tables, so a user to roles, and roles to paths. I am trying to write a function so that from a username and a path it will return a bool value based on whether the user has access to that path. How can I do this with the entity framework? I currently have:

Hi Craig, just had a go with this and on the line: "predicate = predicate.Or (p => p.roles.Any(r => r.Id == role.Id));" I am not able to access role.Id as role is a System.Data.Objects.DataClasses.EntityCollection object rather than a System.Data.Objects.ObjectQuery<roles>. I guess this is due to how I am selecting within rolesForUser though I'm not sure how to get it to come back as this.
–
bobwahJan 4 '10 at 15:45

What is the exact type (with parameters) of rolesForUser?
–
Craig StuntzJan 4 '10 at 16:15

Oh, I see. You have a list of lists. I took a stab at flattening it in the edit.
–
Craig StuntzJan 4 '10 at 16:42

1

Thanks Craig this looks like it's cracked it. I'm going to have a go at making this simpler if I can but this has answered the question. I had to change the line "from r in roles.Role" to be "from r in roles" but other than that it worked.
–
bobwahJan 4 '10 at 17:22