Retrieves the current lock setting. If write is false, all write operations and collection creation are restricted.