This shows you the differences between two versions of the page.
stats:schema:account [2011/10/04 13:52] Patrick Michel |
stats:schema:account [2013/07/10 12:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== User Accounts and Roles ====== | ||
- | |||
- | This page describes a major part of the [[:stats:start]] [[:stats:schema]], namely the user accounts and the [[:stats:roles]] handling. It is part of [[stats]]. | ||
- | |||
- | ===== Schema ===== | ||
- | |||
- | <code xcend> | ||
- | element accounts { [ size(./account/admin) > 0 ] # NEW | ||
- | element account * username { # 2.1 | ||
- | attribute lastName { string } | ||
- | attribute firstName { string } | ||
- | attribute email { string } | ||
- | attribute password { string } | ||
- | |||
- | element admin ? { } | ||
- | element examiner * exam {[ exists //exams/exam[./exam] ]} # 1.1, 2.3 | ||
- | element assistant * exercise {[ exists //exercises/exercise[./exercise] ]} # 1.2, 2.4 | ||
- | element tutor * exercise { | ||
- | element group * id {[ exists //exercises/exercise[../exercise]/groups/group[./id] ]} # 1.3, 2.5 | ||
- | } | ||
- | element student ? { | ||
- | attribute id { ident [ count(., //acounts/account/student/id) = 1 ]} # 2.2 | ||
- | } | ||
- | } | ||
- | } | ||
- | </code> | ||
- | |||
- | ===== Procedures ===== | ||
- | |||
- | ==== Change Attributes ==== | ||
- | |||
- | {{page>stats:proc:changeAttributes (Account)&noheader&nofooter}} | ||
- | ==== Student Role ==== | ||
- | |||
- | The students in the [[exercise]] section, as well as the participants in the [[exam]] section, depend on the student role. This restricts the deletion of the role, i.e. the host language first has to delete these dependencies with corresponding procedures. | ||
- | |||
- | {{page>stats:proc:addStudentId&noheader&nofooter}} | ||
- | |||
- | {{page>stats:proc:removeStudentId&noheader&nofooter}} | ||
- | |||
- | |||
- | ==== Admin Role ==== | ||
- | |||
- | The admin role is pretty much just a flag, without any constraints at all. The precondition is therefore only concerned with uniqueness and trivial stuff. | ||
- | |||
- | {{page>stats:proc:grantAdminRights&noheader&nofooter}} | ||
- | |||
- | {{page>stats:proc:revokeAdminRights&noheader&nofooter}} | ||
- | |||
- | |||
- | ==== Examiner Role ==== | ||
- | |||
- | The examiner role has to fulfill integrity constraints and has a counterpart in the [[exam]] section of the document. | ||
- | |||
- | {{page>stats:proc:grantExaminerRights&noheader&nofooter}} | ||
- | |||
- | {{page>stats:proc:revokeExaminerRights&noheader&nofooter}} | ||
- | |||
- | ==== Assistant Role ==== | ||
- | |||
- | The assistant role relates to exercises like the examiner role relates to exams, so it also has to fulfill integrity constraints and has a counterpart in [[exercise]]. | ||
- | |||
- | {{page>stats:proc:grantAssistantRights&noheader&nofooter}} | ||
- | |||
- | {{page>stats:proc:revokeAssistantRights&noheader&nofooter}} | ||
- | |||
- | ==== Tutor Role ==== | ||
- | |||
- | The tutor role also behaves similarly, but this time it references two identifiers in the [[exercise]] section, where it also has a counterpart. | ||
- | |||
- | This modeling of tutor rights is different from the current implementation. It might also be a nice design, if you can be tutor for an exercise, without (yet) having a group. This would grant some access rights already, I think. | ||
- | |||
- | {{page>stats:proc:grantTutorRights&noheader&nofooter}} | ||
- | |||
- | {{page>stats:proc:revokeTutorRights&noheader&nofooter}} | ||