diff --git a/api/src/rehearsalhub/routers/bands.py b/api/src/rehearsalhub/routers/bands.py index 0c7af89..30c4aaf 100644 --- a/api/src/rehearsalhub/routers/bands.py +++ b/api/src/rehearsalhub/routers/bands.py @@ -25,12 +25,12 @@ async def list_invites( """List all pending invites for a band (admin only)""" repo = BandRepository(session) - # Check if user is admin of this band + # Check if user is a member of this band role = await repo.get_member_role(band_id, current_member.id) - if role != "admin": + if role is None: raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, - detail="Admin role required to manage invites" + detail="Not a member of this band" ) # Get all invites for this band (filter by band_id) diff --git a/api/src/rehearsalhub/routers/versions.py b/api/src/rehearsalhub/routers/versions.py index f5ead69..119f54c 100644 --- a/api/src/rehearsalhub/routers/versions.py +++ b/api/src/rehearsalhub/routers/versions.py @@ -229,6 +229,13 @@ async def stream_version( ): version, _ = await _get_version_and_assert_band_membership(version_id, session, current_member) + # Debug logging for permission issues + import logging + log = logging.getLogger(__name__) + log.info(f"User {current_member.id} accessing version {version_id}") + log.info(f"Song band: {song.band_id}") + log.info(f"User role in band: {role if role else 'NOT A MEMBER'}") + # Prefer HLS playlist if transcoding finished, otherwise serve the raw file if version.cdn_hls_base: file_path = f"{version.cdn_hls_base}/playlist.m3u8"