Posted by yueyuezhou-gdo on August 5, 2008 at 10:04pm
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
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.