Is it possible to have something like meta database?
For example, there is a CV database on the site level. All students are allowed to make their entries, but teachers can search and see entries in this particular database for particular student only if student is enrolled into their courses. Other students are supposed to be invisible for them.