Members¶
Role Hierarchy¶
graph TD
SU[SUPER_USER] -->|creates communities| A[ADMIN]
A -->|manages community| MB[MEMBER]
| Role | Scope | Permissions |
|---|---|---|
SUPER_USER |
Platform | Manages every aspect of the platform and is the only role authorised to create new communities |
ADMIN |
Community | Manages every aspect of the community it manages, including its members, meters, resources, sessions, and energy configuration |
MEMBER |
Own data | May have access (depending on email verification) to the member dashboard, where they can only view their own data and overall community-aggregated information |
Community creation
Only SUPER_USER accounts can create new communities via POST /communities.
ADMIN users have full CRUD access within the communities they manage but cannot
create or delete communities themselves.
Member dashboard access
A MEMBER can only access the member dashboard after verifying their email address.
Unverified members have no access. Once verified, they can see:
- Their own meter measurements and settlement results
- Community-aggregated data (total generation, consumption, savings)
- Their own transaction history
Members cannot see other members' private data (individual loads, measurements, etc.).
User–Community Association¶
A user can belong to multiple communities with a different role in each. The
UserCommunityAssociation links a user to a community with a specific role.
graph LR
U[User] -->|role: ADMIN| C1[Community A]
U -->|role: MEMBER| C2[Community B]
Authentication Flow¶
The platform uses Keycloak-issued Bearer tokens. Each API request is validated against the role embedded in the token, as well as the user's community-specific role stored in the database.
Role in token vs. community role
The JWT carries the platform role (SUPER_USER, USER). Community-specific roles
(ADMIN, MEMBER) are stored in the database and checked separately for each
community-scoped endpoint.
Permission Summary¶
| Action | SUPER_USER | ADMIN | MEMBER |
|---|---|---|---|
| Create community | ✅ | ❌ | ❌ |
| Manage community settings | ✅ | ✅ | ❌ |
| Add / remove members | ✅ | ✅ | ❌ |
| Manage meters & resources | ✅ | ✅ | ❌ |
| Upload meter data | ✅ | ✅ | ❌ |
| Run market / settlement | ✅ | ✅ | ❌ |
| View community aggregated data | ✅ | ✅ | ✅ (verified) |
| View own data | ✅ | ✅ | ✅ (verified) |
| View other members' private data | ✅ | ✅ | ❌ |