Design
Delegate Account is a Moodle local plugin with three layers:
Architecture
Section titled “Architecture”Delegate Account is a Moodle local plugin with three layers:
- Entry points: web-service functions (
classes/external/), pages (pages/), and two hooks (after_config,extend_user_menu). - Services: static classes in
classes/.managerholds the rules of delegations,session_capabilitiesstores and applies overrides,notification_managersends messages,permissionmaps actions to capabilities. - Persistence: two tables,
local_delegateaccountandlocal_delegateaccount_caps.
Two decisions shape the design. First, access is re-evaluated on every request by a hook, so a revoked delegation ends its sessions without a background job. Second, session permissions are applied to the access data of the session, not stored in roles, so they can be changed while sessions are open and never leave a role behind.
Design classes
Section titled “Design classes”Components
Section titled “Components”The plugin sits on five parts of Moodle: login-as, the capability system, the event log, messaging and the database. It adds no table to them and no change to core.
Data model
Section titled “Data model”Use-case realizations
Section titled “Use-case realizations”| ID | Use case | Sequence |
|---|---|---|
| UC-001 | Create delegations | sequence |
| UC-002 | Open a delegated account | sequence |
| UC-003 | Edit session permissions | sequence |
DOC