flask_cognito.py
def _cognito_check_groups(groups: list):
    """
        Does the actual work of verifying the user group to restrict access to some resources.
        :param groups a list with the name of the groups of Cognito Identity Pool
        :raise an exception if there is no group
    """

    if 'cognito:groups' not in current_cognito_jwt or current_cognito_jwt['cognito:groups'] is None:
        raise CognitoAuthError('Not Authorized',
                            'User doesn\'t have access to this resource',
                            status_code=403)

    if all([i not in current_cognito_jwt['cognito:groups'] for i in groups]):
        raise CognitoAuthError('Not Authorized',
                            'User doesn\'t have access to this resource',
                            status_code=403)

        Does the actual work of verifying the user group to restrict access to some resources.
        :param groups a list with the name of the groups of Cognito Identity Pool
        :raise an exception if there is no group
    
Does the actual work of verifying the user group to restrict access to some resources.
:param groups a list with the name of the groups of Cognito Identity Pool
:raise an exception if there is no group
Does the actual work of verifying the user group to restrict access to some resources . : param groups a list with the name of the groups of Cognito Identity Pool : raise an exception if there is no group
def _cognito_check_groups(groups: list):
    if 'cognito:groups' not in current_cognito_jwt or current_cognito_jwt['cognito:groups'] is None:
        raise CognitoAuthError('Not Authorized',
                            'User doesn\'t have access to this resource',
                            status_code=403)
    if all([i not in current_cognito_jwt['cognito:groups'] for i in groups]):
        raise CognitoAuthError('Not Authorized',
                            'User doesn\'t have access to this resource',
                            status_code=403)
def _cognito_check_groups ( groups : list ) : if 'cognito:groups' not in current_cognito_jwt or current_cognito_jwt [ 'cognito:groups' ] is None : raise CognitoAuthError ( 'Not Authorized' , 'User doesn\'t have access to this resource' , status_code = 403 ) if all ( [ i not in current_cognito_jwt [ 'cognito:groups' ] for i in groups ] ) : raise CognitoAuthError ( 'Not Authorized' , 'User doesn\'t have access to this resource' , status_code = 403 )
Does the actual work of verifying the user group to restrict access to some resources.
Does the actual work of verifying the user group to restrict access to some resources .
"""
        Does the actual work of verifying the user group to restrict access to some resources.
        :param groups a list with the name of the groups of Cognito Identity Pool
        :raise an exception if there is no group
    """
groups
list