_aux_auth
_check_project_dirs_update(*, old_project_dirs, new_project_dirs, user_id, db)
async
¶
Raises 422 if by replacing user's project_dirs with new ones we are
removing the access to a zarr_dir used by some dataset.
Note both old_project_dirs and new_project_dirs have been
normalized through os.path.normpath, which notably strips any trailing
/ character. To be safe, we also re-normalize them within this function.
Source code in fractal_server/app/routes/auth/_aux_auth.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
_get_default_usergroup_id_or_none(db)
async
¶
Return the ID of the group named "All", if FRACTAL_DEFAULT_GROUP_NAME
is set and such group exists. Return None, if
FRACTAL_DEFAULT_GROUP_NAME=None or if the "All" group does not exist.
Source code in fractal_server/app/routes/auth/_aux_auth.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
_get_single_user_with_groups(user, db)
async
¶
Enrich a user object by filling its group_ids_names attribute.
| PARAMETER | DESCRIPTION |
|---|---|
user
|
The current
TYPE:
|
db
|
Async db session
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UserRead
|
A |
Source code in fractal_server/app/routes/auth/_aux_auth.py
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
_get_single_usergroup_with_user_ids(group_id, db)
async
¶
Get a group, and construct its user_ids list.
| PARAMETER | DESCRIPTION |
|---|---|
group_id
|
TYPE:
|
db
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
UserGroupRead
|
|
UserGroupRead
|
from database. |
Source code in fractal_server/app/routes/auth/_aux_auth.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
_user_or_404(user_id, db)
async
¶
Get a user from db, or raise a 404 HTTP exception if missing.
| PARAMETER | DESCRIPTION |
|---|---|
user_id
|
ID of the user
TYPE:
|
db
|
Async db session
TYPE:
|
Source code in fractal_server/app/routes/auth/_aux_auth.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |