@check_type(dict)
def indicates_restriction(rights_statement, restriction_acts):
    'Parses a rights statement to determine if it indicates a restriction.\n\n    :param dict rights_statement: an ArchivesSpace rights statement.\n\n    :returns: True if rights statement indicates a restriction, False if not.\n    :rtype: bool\n    '

    def is_expired(date):
        today = datetime.now()
        date = (date if date else datetime.strftime('%Y-%m-%d'))
        return (False if (datetime.strptime(date, '%Y-%m-%d') >= today) else True)
    if is_expired(rights_statement.get('end_date')):
        return False
    for act in rights_statement.get('acts'):
        if ((act.get('restriction') in restriction_acts) and (not is_expired(act.get('end_date')))):
            return True
    return False
Parses a rights statement to determine if it indicates a restriction.

:param dict rights_statement: an ArchivesSpace rights statement.

:returns: True if rights statement indicates a restriction, False if not.
:rtype: bool
@check_type(dict)
def indicates_restriction(rights_statement, restriction_acts):
    'Parses a rights statement to determine if it indicates a restriction.\n\n    :param dict rights_statement: an ArchivesSpace rights statement.\n\n    :returns: True if rights statement indicates a restriction, False if not.\n    :rtype: bool\n    '

    def is_expired(date):
        today = datetime.now()
        date = (date if date else datetime.strftime('%Y-%m-%d'))
        return (False if (datetime.strptime(date, '%Y-%m-%d') >= today) else True)
    if is_expired(rights_statement.get('end_date')):
        return False
    for act in rights_statement.get('acts'):
        if ((act.get('restriction') in restriction_acts) and (not is_expired(act.get('end_date')))):
            return True
    return False