protected function resolveConditions(Lock $lock, $action, $resource)
    {
        // If the given condition is a closure, execute it.
        if ($this->conditions instanceof Closure) {
            return call_user_func($this->conditions, $lock, $this, $action, $resource);
        }

        // If the conditions are an array of Condition objects, check them all.
        foreach ($this->conditions as $condition) {
            if (! $condition->assert($lock, $this, $action, $resource)) {
                return false;
            }
        }

        return true;
    }