def unlock(resource, owner_or_ownerid):
    """

        Unlock a resource using the lock service.  If the resource is already
        locked by a user other than the owner supplied as owner_or_ownerid or
        the resource isn't already locked with this lock type, calling this
        method will raise a :class:`substanced.locking.LockError` exception.
        Otherwise the lock will be removed.

        .. warning::

           Callers should assert that the owner has the ``sdi.lock`` permission
           against the resource before calling this function to ensure that a
           user can't lock a resource he is not permitted to.
       """
