User Tools

Site Tools


stats:schema:account

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
stats:schema:account [2011/09/27 20:47]
Patrick Michel [Assistant Role]
stats:schema:account [2012/04/11 14:33]
Patrick Michel
Line 1: Line 1:
 ====== User Accounts and Roles ====== ====== User Accounts and Roles ======
  
-This page describes a major part of the [[:​stats:​start]] [[:​stats:​schema]],​ namely the user accounts and the role handling.+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 ===== ===== Schema =====
  
 <code xcend> <code xcend>
-  element accounts {+  element accounts {                [ size(./​account/​admin) > 0 ]
     element account * username {     element account * username {
       attribute lastName ​           { string }       attribute lastName ​           { string }
Line 12: Line 12:
       attribute email               { string }       attribute email               { string }
       attribute password ​           { string }       attribute password ​           { string }
 +      attribute code ?              { string }
 +      attribute reset ?             { string }
    
       element admin ?               { }       element admin ?               { }
-      element examiner * exam       {[ exists //​exams/​exam[./​exam] ]} +      element examiner * exam       {[ exists //​exams/​exam[./​exam]/​examiner[../​username] ]} 
-      element assistant * exercise ​ {[ exists //​exercises/​exercise[./​exercise] ]}+      element assistant * exercise ​ {[ exists //​exercises/​exercise[./​exercise]/​assistant[../​username] ]}
       element tutor * exercise {    ​       element tutor * exercise {    ​
-        element group * id          {[ exists //​exercises/​exercise[../​exercise]/​groups/​group[./​id] ]}+        element group * id          {[ exists //​exercises/​exercise[../​exercise]/​groups/​group[./​id]/​tutor[..account/​username] ]}
       }                                    }                             
       element student ? {                  element student ? {           
-        attribute id                { ident [ unique ​//acounts/​account/​student[.] ]}+        attribute id                { ident [ count(., ​//accounts/​account/​student/id) = 1 ]}
       }                                    }                             
     }                                    }                               
Line 31: Line 33:
  
 {{page>​stats:​proc:​changeAttributes (Account)&​noheader&​nofooter}} {{page>​stats:​proc:​changeAttributes (Account)&​noheader&​nofooter}}
 +
 +
 +==== Password Management ====
 +
 +{{page>​stats:​proc:​changePassword&​noheader&​nofooter}}
 +
 +{{page>​stats:​proc:​requestReset&​noheader&​nofooter}}
 +{{page>​stats:​proc:​resetPassword&​noheader&​nofooter}}
 +
 ==== Student Role ==== ==== 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. 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:​setStudentId&​noheader&​nofooter}}+{{page>​stats:​proc:​addStudentId&​noheader&​nofooter}}
  
 {{page>​stats:​proc:​removeStudentId&​noheader&​nofooter}} {{page>​stats:​proc:​removeStudentId&​noheader&​nofooter}}
Line 71: Line 82:
 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. 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.
  
-<code xcend> +{{page>stats:proc:grantTutorRights&​noheader&​nofooter}}
-grantTutorRights(ident username, ident exerciseId, ident groupId) { +
-  assume exists //​accounts/​account[username];​ # implicitly true in OO implementations +
-  assume exists //​exercises/​exercise[exerciseId]/​groups/​group[groupId];​ +
-   +
-  assume not exists //​accounts/​account[username]/​tutor[exerciseId]/​group[groupId]);​ +
-  assume not exists //​exercises/​exercise[exerciseId]/​groups/​group[groupId]/​tutor[account];​ # implied by integrity and the assumption before+
  
-  if not exists //​accounts/​account[username]/​tutor[exerciseId] then # we could split the tutor rights here +{{page>stats:​proc:​revokeTutorRights&​noheader&​nofooter}}
-    insert //​accounts/​account[username] <tutor exercise=[exerciseId] />+
-  fi +
-  insert //​accounts/​account[username]/​tutor[exerciseId] <group id=[groupId] />; +
-  insert //​exercises/​exercise[exerciseId]/​groups/​group[groupId] <tutor account=[account] />; +
-} +
-</​code>​+
  
-<code xcend> 
-revokeTutorRights(ident username, ident exerciseId, ident groupId) { 
-  assume exists //​accounts/​account[username]/​tutor[exerciseId]/​group[groupId];​ # implies the account exists, which is implicitly true anyway 
-  assume exists //​exercises/​exercise[exerciseId]/​groups/​group[groupId]/​tutor[account];​ # implied by integrity and the assumption before 
- 
-  remove //​accounts/​account[username]/​tutor[exerciseId]/​group[groupId];​ 
-  if size(//​accounts/​account[username]/​tutor[exerciseId]/​group) = 0 then # should this be an additional procedure? 
-    remove //​accounts/​account[username]/​tutor[exerciseId];​ 
-  fi 
-  remove //​exercises/​exercise[exerciseId]/​groups/​group[groupId]/​tutor[account];​ 
-} 
-</​code>​ 
stats/schema/account.txt · Last modified: 2013/07/10 12:50 (external edit)