Skip to content

Seed Identity Roles for development#18

Merged
JoeProgrammer88 merged 2 commits intomainfrom
CreateRoles
Oct 4, 2025
Merged

Seed Identity Roles for development#18
JoeProgrammer88 merged 2 commits intomainfrom
CreateRoles

Conversation

@JoeProgrammer88
Copy link
Copy Markdown
Member

Closes #11
Closes #4

This pull request introduces initial support for role-based identity and seeding of a default instructor user in the development environment. It adds a SeedData utility for database seeding, updates the application startup to seed roles and a default user in development, and improves documentation for developers.

Role-based identity and user seeding:

  • Added a new SeedData class in SpeakingInBitsWeb/Models/SeedData.cs that seeds default roles ("Instructor", "Student") and a default instructor user with username DefaultInstructor and password Programming01# in development.
  • Updated SpeakingInBitsWeb/Program.cs to add role support to ASP.NET Identity and to call the seeding methods during application startup in development builds. [1] [2]

Developer documentation and solution structure:

  • Updated README.md with instructions for logging in as the default instructor in development and noted the credentials are seeded via /Models/SeedData.cs.
  • Added README.md as a solution item in SpeakingInBitsWeb.slnx for easier access from the solution explorer.

Enhanced ASP.NET Identity configuration to include role support
by adding `.AddRoles<IdentityRole>()` in `Program.cs`. Introduced
a `SeedData` class to seed predefined roles ("Instructor" and
"Student") and a default instructor user during application
startup in the development environment.
Added a section to the `README.md` detailing how to log in as an instructor in the development environment, including default credentials and a note about the seeded account. Updated the `SpeakingInBitsWeb.slnx` file to include the `README.md` under a new `/Solution Items/` folder.
@JoeProgrammer88 JoeProgrammer88 merged commit d5c5fe2 into main Oct 4, 2025
1 check passed
@JoeProgrammer88 JoeProgrammer88 deleted the CreateRoles branch October 4, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Student Role to Identity system Create an instructor role with the Identity system

1 participant