Skip to content

FastAPI 에서 Custom Permission을 사용하고, Swagger 문서에서 필요한 권한을 보여줌.

Notifications You must be signed in to change notification settings

MinYn/fastapi-permission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 FastAPI Permission Usage (FastAPI 권한 사용 방법)

@router.get("/", response_model=List[SummarySchema])
async def read_all_summaries(
        user_data = Depends(Permission([
            RoleType.OWNER,
            RoleType.EDITOR,
            RoleType.VIEWER
        ])
    )) -> List[SummarySchema]:
    return await crud.get_all()

Result (결과물)

img

Test-Driven Development with FastAPI and Docker

Continuous Integration and Delivery

https://testdriven.io/courses/tdd-fastapi/

About

FastAPI 에서 Custom Permission을 사용하고, Swagger 문서에서 필요한 권한을 보여줌.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published