🛡️ Admin Panel
The Admin Panel is a secure, privileged section of the Teaching Machines platform, accessible only to Super Admins and Organization Admins. It provides robust tools for managing organizations, users, and their roles, ensuring secure and scalable administration of educational content and interactions. This guide details all features, including updates from the provided code, while preserving existing functionality from the original documentation.
🏢 Organization Management
The Organization Management section allows Super Admins to create and configure organizations, each with its own settings, users, and content flows. Organizations can also be mapped to custom domains for branded experiences.
🔒 Super Admin Access Only
- Create Organization: Super Admins can create new organizations using the Create Organization button located in the top-right corner of the Admin Panel.
- Fields:
- Name: The organization’s name (e.g., “Springfield High School”).
- Description: A brief overview of the organization’s purpose or focus.
- Custom Domain Mapping: Optionally map the organization to a custom domain for a tailored user experience.
- Post-Creation: Once created, the organization is added to the platform with its own isolated settings, users, and content.
- Fields:
- View Organizations: Super Admins can view a list of all organizations, including their IDs, names, and descriptions.
- Edit/Delete Organizations: Modify organization details or delete unused organizations (with confirmation to prevent accidental deletion).
Steps to Create an Organization
- Navigate to the Admin Panel from the main dashboard.
- Click the Create Organization button (visible only to Super Admins).
- Fill in the Name and Description fields in the modal.
- Optionally configure a custom domain.
- Click Create Organization to save. A success notification will confirm the action, or an error message will display if the creation fails.
👥 User Management
The User Management section allows admins to view, create, update, and delete users, with access levels determined by their role (Super Admin or Organization Admin). The interface is responsive, offering a table view for desktops and a card view for mobile devices, ensuring usability across platforms.
🧑💼 Super Admin View
- Access: View all users across all organizations.
- Features:
- Show Forbidden Roles: Toggle to display users with restricted or deactivated roles (e.g., “Restricted”).
- Role Modification: Change any user’s role using the Role dropdown in the user table or card.
- User Actions: Edit user details, update passwords, or delete users.
- Organization Filter: Filter users by organization to focus on specific groups.
- Bulk Actions: Perform actions like role changes or deletions on multiple users simultaneously.
🧑🏫 Organization Admin View
- Access: View and manage only users within their own organization.
- Features:
- Show Forbidden Roles: Toggle to view restricted users within the organization.
- Role Modification: Change roles for users within their organization (cannot modify Super Admin roles).
- User Actions: Edit user details, update passwords, or delete users within their organization.
- Limitations: Cannot view or manage users outside their organization or create new organizations.
User Management Interface
- Table View (Desktop):
- Displays columns for Name, Email, Organization, Role, and Actions.
- Sortable by clicking column headers (e.g., sort by name or email in ascending/descending order).
- Expand rows to view additional details like language or organization ID.
- Card View (Mobile):
- Displays user cards with name, email, role, and organization badges.
- Tap to expand for additional details or actions (e.g., edit, delete).
- Filters:
- Search: Filter users by name or email using a search bar.
- Role Filter: Select specific roles (e.g., Teacher, Student) or view all roles.
- Organization Filter (Super Admin only): Filter by organization or view all organizations.
- Pagination: Navigate large user lists with pagination controls, showing total user count and page navigation.
Steps to Manage Users
- In the Admin Panel, expand the User Management accordion.
- Use the search bar, role filter, or organization filter to locate users.
- Click a user row/card to expand details or use the Actions buttons to:
- Edit: Update user details (see Update User section).
- Change Password: Update the user’s password.
- Delete: Remove the user (with confirmation modal).
- Use bulk actions for multiple users if needed.
🎚️ Role Management
Roles define user access levels within the Teaching Machines platform. Each role has specific permissions, and admins can assign or modify roles as needed.
Available Roles
- Super Admin: Full access to all platform features, including organization creation and management of all users.
- Organization Admin: Manages users and content within their own organization; cannot create organizations or manage Super Admins.
- Teacher: Creates and manages educational content (e.g., courses, lessons) but cannot manage users.
- Student: Accesses assigned content and interacts with lessons; no administrative privileges.
- Restricted (Forbidden): A deactivated or restricted role with no access to platform features. Hidden by default but can be shown using the Show Forbidden Roles toggle.
Role Modification
- Interface: Use the Role dropdown next to a user’s name in the table/card view to change their role.
- Immediate Effect: Role changes take effect immediately, updating the user’s access permissions.
- Restrictions:
- Organization Admins cannot assign or modify the Super Admin role.
- Role changes may revoke or grant access to specific platform features (e.g., Admin Panel access).
⚠️ Note: Exercise caution when changing roles, as it may impact a user’s ability to access content or perform actions. A confirmation modal may appear for critical changes.
✍️ Create User
Admins can create new users to grant access to the platform, with options to assign roles and organizations.
Fields for User Creation
- First Name: The user’s first name.
- Last Name: The user’s last name.
- Email: A valid email address for login and notifications.
- Password: A secure password (minimum 8 characters).
- Confirm Password: Must match the password field.
- Organization: Select an organization (disabled for Organization Admins, auto-set to their organization).
- Role: Assign a role (Super Admin, Organization Admin, Teacher, Student, or Restricted).
- Language: Choose a preferred language (e.g., English, Hindi, Swedish, Swahili).
Validation
- Email: Must match a valid email format (e.g., user@domain.com).
- Password: Must be at least 8 characters long and match the confirmation field.
- Organization: Required field; cannot be empty.
- Notifications: Errors (e.g., invalid email, password mismatch) are displayed via toast notifications.
Steps to Create a User
- Click the Create User button in the Admin Panel (visible to Super Admins and Organization Admins).
- Fill in the form fields in the User Creation Modal.
- Submit the form. A success notification confirms the user creation, and the user list updates automatically.
🔄 Update User
Admins can update existing user details, such as name, role, or language, without affecting their login credentials.
Editable Fields
- First Name: Update the user’s first name.
- Last Name: Update the user’s last name.
- Role: Change the user’s role (subject to admin permissions).
- Language: Update the preferred language.
- Email: Displayed but disabled to prevent changes (use password reset for account recovery).
Steps to Update a User
- In the user table/card, click the Edit button (pencil icon) for a user.
- In the Update User Modal, modify the desired fields.
- Click Update User to save changes. A success notification confirms the update.
🔑 Update User Password
Admins can reset or update a user’s password to restore access or enhance security.
Fields
- New Password: Enter a new secure password (minimum 8 characters).
Steps to Update a Password
- In the user table/card, click the Change Password button (key icon).
- In the User Password Update Modal, enter the new password.
- Click Update Password. A success notification confirms the change.
🗑️ Delete User
Admins can delete users to remove their access to the platform. A confirmation modal prevents accidental deletions.
Steps to Delete a User
- In the user table/card, click the Delete button (trash icon).
- Confirm the action in the Warning Modal.
- The user is removed, and the user list updates automatically.
⚠️ Note: Deleting a user is permanent and may affect associated content or records. Ensure you have backups if needed.
🔍 Filtering and Sorting
The User Management section includes robust filtering and sorting options to streamline user administration.
Filters
- Search: Enter a name or email to filter users dynamically.
- Role Filter: Select one or more roles to display (e.g., only Teachers or Students).
- Organization Filter (Super Admin only): Filter users by organization or view all organizations.
- Show Forbidden Roles: Toggle to include/exclude restricted users.
Sorting
- Fields: Sort by Name, Email, Organization, or Role.
- Order: Click column headers (desktop) or use sort controls (mobile) to toggle between ascending and descending order.
- Indicators: Sort direction is indicated by arrows (up for ascending, down for descending) or an equal sign for unsorted fields.
Steps to Filter/Sort
- Use the filter controls above the user table/card to set search, role, or organization filters.
- Click column headers (desktop) or sort options (mobile) to sort users.
- Adjust pagination to navigate through results.
📱 Responsive Design
The Admin Panel is optimized for both desktop and mobile devices:
- Desktop: Displays a sortable table with expandable rows for detailed user information.
- Mobile: Uses a card-based layout with expandable sections for user details and actions.
- Tooltips: Hover (desktop) or tap (mobile) on buttons and fields for additional guidance.
✅ Summary
Feature | Super Admin | Organization Admin |
---|---|---|
View all users | ✅ | ❌ (own org only) |
Change user roles | ✅ (all users) | ✅ (own org only, except Super Admin) |
Create new organizations | ✅ | ❌ |
Create users | ✅ | ✅ (own org only) |
Update user details | ✅ | ✅ (own org only) |
Update user passwords | ✅ | ✅ (own org only) |
Delete users | ✅ | ✅ (own org only) |
Toggle forbidden roles | ✅ | ✅ |
Filter by organization | ✅ | ❌ |
Sort users | ✅ | ✅ |
🛡️ Best Practices
- Role Management: Assign roles carefully to avoid granting excessive permissions.
- User Creation: Ensure email addresses are unique and passwords meet security requirements.
- Notifications: Monitor toast notifications for success or error messages during operations.
- Accessibility: Use tooltips and the help link for guidance.
The Admin Panel provides a secure and efficient interface for managing users and organizations, ensuring scalable and role-based access across the Teaching Machines platform. Use this guide to navigate its features and maintain a well-organized educational environment.