Skip to content

Commit d158c20

Browse files
Merge 430f3bb into a139a8c
2 parents a139a8c + 430f3bb commit d158c20

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/app/api/routes/accesses.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@
44
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
55

66
from typing import List
7-
from fastapi import APIRouter, Path
7+
from fastapi import APIRouter, Path, Security
88
from app.api import crud
99
from app.db import accesses
1010
from app.api.schemas import AccessRead
11+
from app.api.deps import get_current_access
1112

1213

1314
router = APIRouter()
1415

1516

1617
@router.get("/{access_id}/", response_model=AccessRead, summary="Get information about a specific access")
17-
async def get_access(access_id: int = Path(..., gt=0)):
18+
async def get_access(access_id: int = Path(..., gt=0), _=Security(get_current_access, scopes=["admin"])):
1819
"""
1920
Based on a access_id, retrieves information about the specified access
2021
"""
2122
return await crud.get_entry(accesses, access_id)
2223

2324

2425
@router.get("/", response_model=List[AccessRead], summary="Get the list of all accesses")
25-
async def fetch_accesses():
26+
async def fetch_accesses(_=Security(get_current_access, scopes=["admin"])):
2627
"""
2728
Retrieves the list of all accesses and their information
2829
"""

0 commit comments

Comments
 (0)