I have the following situation:
- A chatroom has a 1-n with relationship with classes (so a chatroom always has 1 class and a class can have multiple chatrooms).
- A teacher has a n-n relationship with classes. (so a teacher can have multiple classes and classes can have multiple teachers)
When I log in as a teacher I want to see a list of all chatrooms that share the same classes as I have.
ID - Class
1 - class A
2 - class B
3 - class A
4 - class C
Name - Class
John - class A, class B
Maria - class A, class C
Harry - class C
So when I log in as John, I want to see a list of chatroom 1, 2 and 3.
When I log in as Maria, I want to see a list of chatrooms 1, 3 and 4
As Harry, I only want to see chatroom 4.
For some reason I cannot filter it like this: