- Fork elmeg-demo codebase for multi-band support - Add data importer infrastructure with base class - Create band-specific importers: - phish.py: Phish.net API v5 - grateful_dead.py: Grateful Stats API - setlistfm.py: Dead & Company, Billy Strings (Setlist.fm) - Add spec-kit configuration for Gemini - Update README with supported bands and architecture
15 lines
507 B
Python
15 lines
507 B
Python
from fastapi import Depends, HTTPException, status
|
|
from models import User
|
|
from auth import get_current_user
|
|
|
|
class RoleChecker:
|
|
def __init__(self, allowed_roles: list[str]):
|
|
self.allowed_roles = allowed_roles
|
|
|
|
def __call__(self, user: User = Depends(get_current_user)):
|
|
if user.role not in self.allowed_roles:
|
|
raise HTTPException(
|
|
status_code=status.HTTP_403_FORBIDDEN,
|
|
detail="Operation not permitted"
|
|
)
|
|
return user
|