(20250123) Made a common API to disable all integrations.

This commit is contained in:
2025-01-23 12:29:03 +05:30
parent 816789fce5
commit fe48b79c09
20 changed files with 663 additions and 36 deletions
+19
View File
@@ -153,6 +153,25 @@ async def is_not_authorized(
return not authorized
# ---------------------------------------------------------------------------------------------------------------------
def get_authorization_filter(user_info: CoreUserInfoModel) -> dict:
"""
Just returns a MongoDB query filter that can be sent as an 'additional_filter' to various methods to ensure that the
user requesting the service and the user that has rights over the resource are matching.
:param user_info: The information of the user obtained from the session.
:return: A filter condition.
"""
return AsyncMongo.dict_to_dot_notation({
"user": {
"billingAccountId": user_info.billingAccountId
}
})
# *****************************************************************************************************************
# ***** ****
# *** MAIN PROGRAM ***