💻 Part 6: From Code to Click – Security, Permissions & Building Kai’s Dashboard
July 1, 2025
After learning stored procedures and date functions, Kai was ready for the next challenge: making the database safe and building something real people could click and use.
🔐 Permissions: Who Gets to Do What?
We started with a simple but powerful idea: not everyone should be able to change everything.
I told Kai, “Imagine giving teachers the keys to mark attendance, but not delete students by accident.”
We created roles in SQL Server:
CREATE ROLE TeacherRole;
GRANT EXECUTE ON MarkAttendance TO TeacherRole;
Then added a user and assigned the role:
CREATE LOGIN Teacher1 WITH PASSWORD = 'SecurePass123!';
CREATE USER Teacher1 FOR LOGIN Teacher1;
EXEC sp_addrolemember 'TeacherRole', 'Teacher1';
“So Teacher1 can mark attendance, but nothing else?” Kai asked. Exactly. Principle of least privilege in action. 🔒
🧩 Kai’s First Dashboard UI
Then the big one: Kai brought me a sketch a simple web page with two boxes:
- Who is enrolled?
- Who showed up this week?
We started building it using ASP.NET (yes, with real HTML and C#), connecting it to the stored procedures he had already written:
// ASP.NET Backend Sample
SqlCommand cmd = new SqlCommand("GetWeeklyAttendance", conn);
cmd.CommandType = CommandType.StoredProcedure;
And then showed the results in a basic table:
<table>
<tr><th>Student ID</th><th>Course</th><th>Days Present</th></tr>
<% foreach (var row in attendanceData) { %>
<tr><td><%= row.StudentID %></td><td><%= row.CourseName %></td><td><%= row.DaysPresent %></td></tr>
<% } %>
</table>
“It’s like turning SQL into something people can use,” Kai said.
Exactly. And that’s where coding becomes empowering. 🧠
💡 Security Meets Design
We made sure the dashboard only worked when you logged in with the right credentials. We added:
- 🔑 Basic login with hashed passwords
- 🔍 Server-side checks for user roles
- 📄 Read-only pages for students
Kai even insisted on a “forgot password” link — because “people always forget stuff.” 😅
✨ More Than Code: Seeing the Bigger Picture
Watching Kai map out UI screens, worry about what buttons should do, and protect the database all while making it easier for teachers blew me away.
He wasn’t just using the tools he was thinking like a system designer. With empathy. With structure. With pride.
And that’s what this journey is really about. ❤️
👀 Coming in Part 7: Logging Absences & Building Reports
Next time, we’ll expand our system by logging absences, building summary reports, and maybe even integrating with a calendar API so students can see their schedule. 🗓️
Kai’s asking questions like: “Can we colour-code the dashboard for frequent absences?” and “Can students log in to see their record?”
Yes, and yes. Let’s build it. Together.
🫶 Keep Showing Up
If you're a neurodivergent learner, a parent, a carer — keep showing up. Progress may not always look linear, but growth is happening.
Kai’s story is living proof: with patience, passion, and the right support, amazing things happen.
See you in Part 7. Until then:
- 💬 Ask the next question
- 🧠 Build something useful
- 💙 Believe in your pace
Because different doesn’t mean broken. Different often means brilliant.
Comments
Post a Comment