def METHOD_NAME(fn):
    """Decorate to check permission access.
    The access is allow when the connected user and the profile is not in
    readonly.
    """
    @wraps(fn)
    def is_user_readonly(*args, **kwargs):
        """Decorated view."""
        if current_app.config.get('RERO_PUBLIC_USERPROFILES_READONLY', False) \
                or not current_user.is_authenticated:
            abort(401)
        return fn(*args, **kwargs)
    return is_user_readonly