2026.06.04 frontend építés közben
This commit is contained in:
27
backend/check_user_scope.py
Normal file
27
backend/check_user_scope.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import asyncio
|
||||
from app.db.session import AsyncSessionLocal
|
||||
from app.models.identity import User
|
||||
from app.core.security import create_tokens
|
||||
from sqlalchemy import select
|
||||
|
||||
async def main():
|
||||
async with AsyncSessionLocal() as db:
|
||||
result = await db.execute(select(User).where(User.id == 28))
|
||||
user = result.scalar_one_or_none()
|
||||
if not user:
|
||||
print("User 28 not found")
|
||||
return
|
||||
|
||||
print(f"User found: {user.email}, Scope ID: {user.scope_id}, Scope Level: {user.scope_level}")
|
||||
|
||||
# Check organization membership
|
||||
from app.models.marketplace.organization import OrganizationMember
|
||||
org_result = await db.execute(
|
||||
select(OrganizationMember).where(OrganizationMember.user_id == 28)
|
||||
)
|
||||
memberships = org_result.scalars().all()
|
||||
for m in memberships:
|
||||
print(f"Organization membership: org_id={m.organization_id}, role={m.role}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user