Only owner decorator
    Restricts access to view ony to profile owner

def only_owner(func):
    """
    Only owner decorator
    Restricts access to view ony to profile owner
    """
    def decorated(*_, **kwargs):
        id = kwargs['id']
        if not current_user.is_authenticated:
            abort(401)
        elif current_user.id != id:
            abort(403)
        return func(**kwargs)

    return decorated