This is an old revision of the document!
The stats element represents the whole system, i.e. its XCend Schema is not repeated here. The main parts of the system are
The procedures to create and manage these major parts are among the most important ones of the system.
Two of the most important procedures, as they create and remove elements of a major part of the system, namely User Accounts and Roles.
Naturally, a lot of things depend on accounts and their associated roles. Especially the student role restricts the deletion of accounts.
# This doesn't take account validation into consideration at all. It probably has to be allowed to replace an unvalidated account. createAccount(ident uid, ident username, string lastName, string firstName, string email, string password) { assume exists /account[uid]/admin; assume not exists /account[username]; insert / <account username=[username] lastName=[lastName] firstName=[firstName] email=[email] password=[password] /> }
Also two of the most important procedures, as they create and remove elements of a major part of the system, namely Exercise Management and Sheets.
A few roles, like tutor and assistant, depend on the existence of an exercise. Students sign-up status, on the other hand, just gets removed as well.
createExercise(ident uid, ident id, string lecture, string term) { assume exists /account[uid]/admin; assume not exists /exercise[id]; insert / <exercise id=[id] lecture=[lecture] term=[term] open=[false] /> }
The admin role procedures from User Accounts and Roles can be offered here, too.
grantAdminRights(ident uid, ident username) { assume exists /account[uid]/admin; assume exists /account[username]; # implicitly true in OO implementations assume not exists /account[username]/admin; insert /account[username] <admin />; }
revokeAdminRights(ident uid, ident username) { assume exists /account[uid]/admin; assume exists /account[username]/admin; # implies the account exists, which is implicitly true anyway assume size(/account/admin) > 1; # kind of a practical constraint remove /account[username]/admin; }