Create Group of Students, assign Books to these Groups from Pages

Hello All, I am searching for a solution, Lets suppose I have 3 Entities: Student Group Books   Each student can belong to one, or many Groups Each Group of Students can access only Some Book (Security Part)   I want to create Students, Groups From Web-Page ONLY, assign students to specific group and then assign Books to Specific Groups from Web Page Only   How can this be achieved in Mendix.   Thanks  
2 answers

1) Create 3 Entities
-  Student (Generalization of Administration.Account) in case each one of them are going to be the users of the system)
-  Group  
-  Book

Essentially, both books and students belong to one or many groups. For a student to access the book, he/she must be assigned to at least one of the group(s) that the book belongs to 

2) Create Association Student_Group    (Many-Many)

3) Create Association  Book_Group (Many-Many)   

4) Create a Microflow as data source for Book Pages 
This workflow should 
a) Retrieve the groups that the student belongs to
b) Retrieve for each of the group above, the books into one list (in a loop)

Pass that list as the object to the Book Page

Hope this helps. if you need more help, please let me know


A simpler, though less flexible solution would be to create SecurityLevel  (attribute of Book Entity) for each book 1,2,34 etc and assign each group a SecurityLevel (attribute of Group Entity)

You can check the highest securityLevel of student by checklist the highest security level of his/her groups. If that is >= the book security level, student can access the book. But this will also need a microflow to implement since XPath doesn’t support nested query