Schools & Rooms API
Manage educational spaces, user memberships, and real-time WebRTC rooms in Ilmfun.
Overview
Schools in Ilmfun are hierarchical spaces that can contain multiple Rooms. Users can join Schools as members, and Rooms can have granular permissions controlling who can join their WebRTC sessions.
Room Permissions (allowed_roles)
Each room now supports granular access control through the allowed_roles property. When creating or managing a room, you can specify who is permitted to join:
everyoneorall: Anyone can join the room. Non-members will automatically be assigned the Visitor role in the WebRTC session. This is typically used for public spaces like Campus or Reception.members(Default): Only users who have been explicitly added to the school'sschool_memberslist can join. This ensures the room is private to the school community.- Specific Roles (e.g.,
Student,Teacher): Only school members who hold one of these specific roles (or the Owner) are allowed to join. Role names must match the school's custom roles exactly.
Owner Access: The creator of a school (the Owner) bypasses all room-level role restrictions and can join any room in their school.
Listing Rooms
To list rooms for a school, use GET /schools/{id}/rooms.
If a school is set to Public, any user (including Visitors) can list its rooms to browse the available spaces. However, joining those rooms is still strictly enforced by each room's allowed_roles configuration.
Membership & Roles
When fetching a school via GET /schools/{id}, the response includes a role field indicating the user's current membership status within that school.
{
"id": 1,
"name": "Global Academy",
"is_public": true,
"role": "Student"
}
Visitor Status: If a user is not a member of the school, the role field will be omitted entirely. Do not assume non-members have a "Visitor" role in the school_members database.