ScotterMonk / scottswain

This project is in support of efforts to hire python engineers.
MIT License
0 stars 0 forks source link

Issue 02-Active Users #3

Closed ScotterMonk closed 1 week ago

ScotterMonk commented 1 week ago

Assignment

As an application administrator, I want to be able to mark a user as "inactive" so that they cannot log in or perform any actions on the system.

Acceptance Criteria

ScotterMonk commented 1 week ago

How to use it

Access report

Shows user, email, role, and if active.

Bash

(Note: can replace "all_users" below with "active_users" or "inactive_users")

curl -X POST http://127.0.0.1:5000/access-report \
     -H "Content-Type: application/json" \
     -d '{"limit_to":"all_users"}'

Windows

(Note: can replace "all_users" below with "active_users" or "inactive_users")
Invoke-WebRequest -Uri http://127.0.0.1:5000/access-report -Method POST -Headers @{"Content-Type" = "application/json"} -Body '{"limit_to":"all_users"}'

Toggle active/inactive status

Bash

(Note: can replace "all_users" below with "active_users" or "inactive_users")

curl -X POST http://127.0.0.1:5000/toggle-active \
     -H "Content-Type: application/json" \
     -d '{"email":"dev.userson@example.com"}'

Windows

Invoke-WebRequest -Uri http://127.0.0.1:5000/toggle-active -Method POST -Headers @{"Content-Type" = "application/json"} -Body '{"email":"dev.userson@example.com"}'

Added table: users_active_status_changes (id, id_user, status, date), along with foreign key to id_user.

Added routes: