|
13 | 13 | # See the License for the specific language governing permissions and |
14 | 14 | # limitations under the License. |
15 | 15 | # =============================================================================== |
16 | | -from typing import Annotated |
| 16 | +from typing import Annotated, TypeAlias |
17 | 17 |
|
18 | 18 | from fastapi import Depends |
19 | 19 | from sqlalchemy.orm import Session |
20 | 20 |
|
21 | 21 | from core.permissions import authenticated |
22 | 22 | from db.engine import get_db_session |
23 | 23 |
|
24 | | -session_dependency: type[Session] = Annotated[Session, Depends(get_db_session)] |
| 24 | +session_dependency: TypeAlias = Annotated[Session, Depends(get_db_session)] |
25 | 25 |
|
26 | 26 | """ |
27 | 27 | Developer Notes |
|
61 | 61 |
|
62 | 62 |
|
63 | 63 | # Permissions Dependencies ----------------------------------------------------- |
64 | | -admin_dependency: type[dict] = Annotated[dict, Depends(admin_function)] |
65 | | -editor_dependency: type[dict] = Annotated[dict, Depends(editor_function)] |
66 | | -viewer_dependency: type[dict] = Annotated[dict, Depends(viewer_function)] |
| 64 | +admin_dependency: TypeAlias = Annotated[dict, Depends(admin_function)] |
| 65 | +editor_dependency: TypeAlias = Annotated[dict, Depends(editor_function)] |
| 66 | +viewer_dependency: TypeAlias = Annotated[dict, Depends(viewer_function)] |
67 | 67 |
|
68 | | -lexicon_admin_dependency: type[dict] = Annotated[dict, Depends(lexicon_admin_function)] |
69 | | -lexicon_editor_dependency: type[dict] = Annotated[ |
70 | | - dict, Depends(lexicon_editor_function) |
71 | | -] |
| 68 | +lexicon_admin_dependency: TypeAlias = Annotated[dict, Depends(lexicon_admin_function)] |
| 69 | +lexicon_editor_dependency: TypeAlias = Annotated[dict, Depends(lexicon_editor_function)] |
72 | 70 |
|
73 | | -amp_admin_dependency: type[dict] = Annotated[dict, Depends(amp_admin_function)] |
74 | | -amp_editor_dependency: type[dict] = Annotated[dict, Depends(amp_editor_function)] |
75 | | -amp_viewer_dependency: type[dict] = Annotated[dict, Depends(amp_viewer_function)] |
| 71 | +amp_admin_dependency: TypeAlias = Annotated[dict, Depends(amp_admin_function)] |
| 72 | +amp_editor_dependency: TypeAlias = Annotated[dict, Depends(amp_editor_function)] |
| 73 | +amp_viewer_dependency: TypeAlias = Annotated[dict, Depends(amp_viewer_function)] |
76 | 74 |
|
77 | | -no_permission_dependency: type[dict] = Annotated[dict, Depends(no_permission_function)] |
| 75 | +no_permission_dependency: TypeAlias = Annotated[dict, Depends(no_permission_function)] |
78 | 76 | # ============= EOF ============================================= |
0 commit comments