_aux_auth
_get_single_user_with_groups(user, db)
async
¶
Enrich a user object by filling its group_ids_names
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
UserOAuth
|
The current |
required |
db |
AsyncSession
|
Async db session |
required |
Returns:
Type | Description |
---|---|
UserRead
|
A |
Source code in fractal_server/app/routes/auth/_aux_auth.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
_get_single_usergroup_with_user_ids(group_id, db)
async
¶
Get a group, and construct its user_ids
list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_id |
int
|
|
required |
db |
AsyncSession
|
|
required |
Returns:
Type | Description |
---|---|
UserGroupRead
|
|
UserGroupRead
|
from database. |
Source code in fractal_server/app/routes/auth/_aux_auth.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
_user_or_404(user_id, db)
async
¶
Get a user from db, or raise a 404 HTTP exception if missing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id |
int
|
ID of the user |
required |
db |
AsyncSession
|
Async db session |
required |
Source code in fractal_server/app/routes/auth/_aux_auth.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|