case study: student progress/report card

Events happening in the community are now at Drupal community events on www.drupal.org.
yueyuezhou-gdo's picture

1 user account (parents), multiple kids (may even be in the same class).

parent -> user with parent role
teacher -> user with teacher role
class -> group created by the teach, his/her student are the members (logically)
report card -> new node type

patent is allow to see the report card for his/her children only

how to model the student? and control the security?

Comments

Hook_access

dwees's picture

Ok so first you need some convenient way to define a relationship between parents and students. It may be that you want to use Node Profile or Bio and create a User Reference within the Parent profile that leads to the student, or between the student profile that leads to the parent or both. Some kind of easy relationship that is convenient to manage (without raw SQL queries).

You can then create a simple module with two hooks, hook_node_grants and hook_node_access_records. The first lets you define new access realms, the 2nd lets you define permissions for users.

This has the advantage of playing nicely with other access control modules.

Drupal in Education

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: