This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
stats:proc:grantassistantrights [2011/09/28 23:50] Patrick Michel |
stats:proc:grantassistantrights [2013/07/10 12:32] (current) |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| <code xcend> | <code xcend> | ||
| - | grantAssistantRights(ident username, ident exerciseId) { | + | grantAssistantRights(ident uid, ident username, ident exerciseId) { |
| - | assume exists //accounts/account[username]; # implicitly true in OO implementations | + | assume exists /account[uid]/admin; |
| - | assume exists //exercises/exercise[exerciseId]; | + | |
| - | assume not exists //accounts/account[username]/assistant[exerciseId]); | + | assume exists /account[username]; # implicitly true in OO implementations |
| - | assume not exists //exercises/exercise[exerciseId]/assistant[account]; # implied by integrity and the assumption before | + | assume exists /exercise[exerciseId]; |
| - | insert //accounts/account[username] <assistant exercise=[exerciseId] />; | + | assume not exists /account[username]/assistant[exerciseId]); |
| - | insert //exercises/exercise[exerciseId] <assistant account=[account] />; | + | assume not exists /exercise[exerciseId]/assistant[username]; # implied by integrity and the assumption before |
| - | } # roles: admin | + | |
| + | insert /account[username] <assistant exercise=[exerciseId] />; | ||
| + | insert /exercise[exerciseId] <assistant account=[username] />; | ||
| + | } | ||
| </code> | </code> | ||