Validate that the provider user is either admin or requesting to decrypt value for themselves.
(decrypt, scope, is_admin, user_db)
| 42 | |
| 43 | |
| 44 | def _validate_decrypt_query_parameter(decrypt, scope, is_admin, user_db): |
| 45 | """ |
| 46 | Validate that the provider user is either admin or requesting to decrypt value for |
| 47 | themselves. |
| 48 | """ |
| 49 | is_user_scope = scope == USER_SCOPE or scope == FULL_USER_SCOPE |
| 50 | if decrypt and (not is_user_scope and not is_admin): |
| 51 | msg = "Decrypt option requires administrator access" |
| 52 | raise AccessDeniedError(message=msg, user_db=user_db) |
| 53 | |
| 54 | |
| 55 | def get_datastore_full_scope(scope): |
nothing calls this directly
no test coverage detected