User Tools

Site Tools


Action disabled: source
stats:role:user

User Role

Although not a manifested role by itself, anyone having an account can most likely invoke a few procedures from User Accounts and Roles.

Parameter: Username

Access right

A user should be able to see his own account details and what rights he has, from the User Accounts and Roles section. It might also be a good idea to show all the exercises from Exercise Management and Sheets and exams from Exam Management and Grades to every user, so visibility of these basic top elements and theirs attributes is not bound to any specific role and these roles only grant more rights for individual elements.

Procedures

Account Management

changePassword(ident uid, ident username, string password) {
  assume exists /account[uid]/admin || uid = username;
 
  assume exists /account[username]; # implicitly true in OO implementations
 
  update /account[username]/password password;
}
requestReset(ident username, string reset) {
  assume exists /account[username];
 
  assume not exists /account[username]/code; # account is already validated
 
  if not exists /account[username]/reset then
    insert /account[username]/reset;
  fi
  update /account[username]/reset reset;
}
resetPassword(ident username, string reset, string password) {
  assume exists /account[username]/reset; # reset code was requested before, implies account exists
  assume /account[username]/reset = reset; 
 
  remove /account[username]/reset;
  update /account[username]/password password;
}
stats/role/user.txt · Last modified: 2012/01/11 14:51 by Patrick Michel