human
Complete this python program:
def can_access_account(func):
assistant
#Here is the Python code you requested.

    """Check if User can access account information.
    """
    @wraps(func)
    def wrapper(*args, **kwargs):
        user = getattr(g, 'user', None)
        user_id = kwargs.get('user_id')
        get_object_or_404(UserModel, user_id)
        if (user and ((user.id == user_id) or user.is_staff)):
            return func(*args, **kwargs)
        else:
            raise PermissionDeniedError()
    return wrapper