Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for current_user (0.1 sec)

  1. docs/en/docs/tutorial/dependencies/index.md

    ```mermaid
    graph TB
    
    current_user(["current_user"])
    active_user(["active_user"])
    admin_user(["admin_user"])
    paying_user(["paying_user"])
    
    public["/items/public/"]
    private["/items/private/"]
    activate_user["/users/{user_id}/activate"]
    pro_items["/items/pro/"]
    
    current_user --> active_user
    active_user --> admin_user
    active_user --> paying_user
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Oct 28 11:18:17 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  2. fastapi/param_functions.py

        app = FastAPI()
    
        @app.get("/users/me/items/")
        async def read_own_items(
            current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
        ):
            return [{"item_id": "Foo", "owner": current_user.username}]
        ```
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 23 18:30:18 UTC 2024
    - 62.5K bytes
    - Viewed (0)
  3. docs/en/docs/release-notes.md

    ```Python
    CurrentUser = Annotated[User, Depends(get_current_user)]
    ```
    
    And then you can reuse this `Annotated` dependency:
    
    ```Python
    CurrentUser = Annotated[User, Depends(get_current_user)]
    
    
    @app.get("/items/")
    def read_items(user: CurrentUser):
        ...
    
    
    @app.post("/items/")
    def create_item(user: CurrentUser, item: Item):
        ...
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Nov 01 11:25:57 UTC 2024
    - 460.3K bytes
    - Viewed (0)
Back to top