How access is decided
The two conditions that must hold, the life of a delegation and when a delegated session ends.
Delegate Account does not open accounts by itself: it decides whether Moodle’s own Log in as may be used for a given pair of users at a given moment.
Two conditions
Section titled “Two conditions”Two conditions must be met for someone to open an account:
They hold the permission
They have local/delegateaccount:use in the system context, or they are a site administrator.
A delegation exists
An administrator created a delegation from them to that account, and it is currently active.
The life of a delegation
Section titled “The life of a delegation”Each delegation moves through four statuses, and the status is calculated from its dates, not stored.
| Status | Meaning |
|---|---|
| Scheduled | The start date has not been reached yet |
| Active | The account can be opened now |
| Expired | The end date has passed |
| Revoked | An administrator ended it. Revoked delegations are kept for the record |
To give access again after a delegation expires, edit the expired delegation instead of creating a new one.
When a delegated session ends
Section titled “When a delegated session ends”Access is checked when the account is opened and again on every page while the delegated session lasts. A revoked delegation ends its open sessions at once. The session ends on the next page if:
- the delegation expires;
- the person loses the permission;
- the account is suspended or deleted;
- the account becomes a site administrator while that is protected (see the security model).
Nothing depends on cron: start and end dates are checked each time, so delegations start and stop on time.
DOC