(20250123) Made a common API to disable all integrations.
This commit is contained in:
@@ -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 ***
|
||||
|
||||
Reference in New Issue
Block a user