Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,34 @@ Supported file types:

**📚 For detailed setup instructions, see [QUICKSTART.md](QUICKSTART.md)**

---

## ✅ Runtime Validation & Demo Artifacts

The FEAS project has been executed locally and validated with both backend and frontend checks.

### Validation Commands

```bash
# Backend tests
cd backend
python -m pytest tests/ -v

# Frontend production build
cd ../frontend
npm run build
```

### Captured Runtime Media

The following artifacts were captured from a live FEAS run:

- **Home Screen Screenshot:** [`docs/media/feas-home.png`](docs/media/feas-home.png)
- **Submission Screen Screenshot:** [`docs/media/feas-submission.png`](docs/media/feas-submission.png)
- **Short Demo Video:** [`docs/media/feas-demo.webm`](docs/media/feas-demo.webm)

These media files provide visual confirmation of application startup, routing, and UI availability.

### Option 1: Quick Start (Docker) 🐳

1. **Clone the repository**
Expand Down
12 changes: 12 additions & 0 deletions backend/app/api/v1/endpoints/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,15 @@ async def get_me(current_user: User = Depends(get_current_user), db: Session = D
async def logout():
"""Logout (client-side token removal)"""
return {"message": "Successfully logged out"}


def get_user_role(db: Session, user: User) -> str:
profile = db.query(UserProfile).filter(UserProfile.user_id == user.id).first()
return (profile.role if profile and profile.role else "Analyst").strip()


def user_has_any_role(db: Session, user: User, allowed_roles: list[str]) -> bool:
if user.is_admin:
return True
role = get_user_role(db, user).lower()
return role in {r.lower() for r in allowed_roles}
Loading